anchor

Anchor's Download Property is not working on some pages (Gmail)?

泄露秘密 提交于 2019-11-30 03:25:29
问题 I want to insert this HTML element in some pages: <a download="somedata.csv" id="downloadLink" href="data:application/csv;charset=utf-8,Col1%2CCol2%2CCol3%0AVal1%2CVal2%2CVal3%0AVal11%2CVal22%2CVal33%0AVal111%2CVal222%2CVal333" > Click Me </a> In all pages, when I change the dom via plugin or manually in elements inspector, to include this element to page's dom, it works great ! But, if I do the same in Gmail pages, the file generated is not named " somedata.csv " and the extension is lost "

Div anchors scrolling too far

让人想犯罪 __ 提交于 2019-11-30 03:02:09
I'm using a static bar at the top of my site, about 20px high. When I click an anchor link(for those who don't know, the navigation on wikipedia works like that. Click a title and the browser goes down to it) part of the text disappears behind that top bar. Is there any way to stop this from happening? I'm not in a position where I can use an iFrame. Onlything I can think of is make it scroll back a bit each time, but is there another way? Some CSS setting to manipulate the body or something? Christoph To fix this with CSS you can add a padding to the Elements you want to jump to: Example

How to launch a file protocol URL with an anchor from Java?

房东的猫 提交于 2019-11-30 01:55:09
问题 From a Java program, I need to launch the default browser on a local HTML file, pointed to an anchor inside the file. In Java SE 6, the java.awt.Desktop.browse method will open the file, but will not honor the anchor, so something like the following opens the file at the top, but does not page the browser to the anchor: Desktop.getDesktop("file:///C:/foo/bar.html#anchor"); Sun says here http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6477862 that anchors are not supported in the file URI

jquery click on anchor element forces scroll to top?

两盒软妹~` 提交于 2019-11-30 01:53:59
jQuery hyperlinks - href value? text][1] I am running in to a problem using jquery and a click event attached to an anchor element. [1]: jQuery hyperlinks - href value? "This" SO question seems to be a duplicate, and the accepted answer doesn't seem to solve the problem. Sorry if this is bad SO etiquette. In my .ready() function I have: jQuery("#id_of_anchor").click(function(event) { //start function when any update link is clicked Function_that_does_ajax(); }); and my anchor looks like this: <a href="#" id="id_of_anchor"> link text </a> but when the link is clicked, the ajax function is

javascript:; vs javascript:void(0);

安稳与你 提交于 2019-11-30 01:47:54
I would like to know what is the difference between javascript:; and javascript:void(0); if I use them in href attribure for a anchor (link) <a href="javascript:;" onclick="DoSomething();">Link</a> <a href="javascript:void(0);" onclick="DoSomething();">Link</a> I see them acting the same on all browsers but what is the technical difference? Regards, Magdy One runs JavaScript that has no statements, the other runs JavaScript that evaluates the statement 0 and then returns undefined . Neither should be used. I agree with David that neither should be used. The javascript pseudo-protocol can put

page jump from div to an anchor

∥☆過路亽.° 提交于 2019-11-30 01:47:42
问题 I was trying to make a div jump from <a href="#FAQ">FAQ</a> to a div id and could success easily, but since I have a fixed link to jump to, I can't seem to find a way how to do that. Meaning, I want a div or a href link to jump to a url in the same page say <a href="http://www.mydomain.ask.html">Ask</a> I know for sure that jumping from an anchor such as <a href="#jump">jump</a> to a div such as <div id="jump">jump to point</div> works fine. However, how about the opposite way? does it work?

jQuery scroll to anchor (minus set amount of pixels)

半世苍凉 提交于 2019-11-29 23:54:00
I am using the following code to scroll to anchor points with jQuery: $(document).ready(function() { function filterPath(string) { return string .replace(/^\//,'') .replace(/(index|default).[a-zA-Z]{3,4}$/,'') .replace(/\/$/,''); } var locationPath = filterPath(location.pathname); var scrollElem = scrollableElement('html', 'body'); $('a[href*=#]').each(function() { var thisPath = filterPath(this.pathname) || locationPath; if ( locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && this.hash.replace(/#/,'') ) { var $target = $(this.hash), target = this.hash; if

jQuery: Capture anchor href onclick and submit asynchronously

旧城冷巷雨未停 提交于 2019-11-29 21:23:42
I almost never get to play with client-side stuff, and this presumably simple task is kicking my butt :) I have some links. OnClick I want to prevent the default action, capture its href url, submit an ajax GET to that url, and simply alert() with the results ... but I can't even get past the starting line :) Example anchors for play-time: <a class="asynch_link" href="good/1.html">Click Here</a> <a class="asynch_link" href="good/2.html">Click Here</a> Now, I've played with a few suggestions for similar requests on SO, but the links still cause the browser to navigate to the href url. Even with

a vs a:link, What is the difference?

五迷三道 提交于 2019-11-29 20:48:40
What is the differences between a {...} and a:link{...} ? Are there different usages, and benefits between them? According to W3C a:link is for not visited, a:visited is for visited, and just a applies to both. a covers all the bases. a:link is used only if the link in un- visited , un- hover ed, and in- active . So, use a for things like font-family (if you want links to come up in a different font), then use link for the standard formatting, and visited , hover and active for 'special effects'. EDIT: After reading Sander's W3C link , I can see that I didn't have it quite right. a:link will

Disable color change of anchor tag when visited

烈酒焚心 提交于 2019-11-29 20:22:45
I have to disable the color change of an anchor tag when visited. I did this: a:visited{ color: gray } (The link is gray in color before visited.) But this is a way where I explicitly state the color after the link is visited, which is again a color change. How can I disable the color change of an anchor tag when visited without doing any explicit color changes? Rich Bradshaw You can't. You can only style the visited state. For other people who find this, make sure that you have them in the right order: a {color:#FF0000;} /* Unvisited link */ a:visited {color:#00FF00;} /* Visited link */ a