anchor

Force browser to not use cache when requested for file using anchor tag

烈酒焚心 提交于 2019-12-05 14:54:00
I have an anchor tag that is used to request the download of a file. Like this: <a href="app/results?fileName=t12.txt&other-param=something" title="Click to download"> Download </a> The file may be modified on the server very often, so I want to make sure the browser does not cache the file. However, testers found out that, although it seems to always download the file when you click on the link, when you right-click on the link and choose "Save As...", the browser seems to choose to use the cached file instead. This was tested with IE9. How can I force the browser (especially IE9) to always

The element a must not appear as a descendant of the button element

邮差的信 提交于 2019-12-05 07:49:33
Please help, I am getting error via http://validator.w3.org/ while validating my html5 template. I get the message " The element a must not appear as a descendant of the button element". I can't understand this. Could anyone help me to solve this? Here is my code--- <div class="post-response btn-group btn-group-lg"> <a href="#"><button type="button" class="btn btn-default"><i class="fa fa-comment"> 5 Comments</i></button></a> <a href="#"><button type="button" class="btn btn-default"><i class="fa fa-heart"> 5 Likes</i></button></a> </div> The Error Message have Answered Your doubt Already

Change background image of <li> on click of <a> tag

一笑奈何 提交于 2019-12-05 06:56:23
问题 html: <ul> <li id="Co" class="libgc" ><b>CO</b></li> <li id="NSCO" class="libgc active"><span> <a href="#NSale.php" target="homeFrame" class="aclass">NSale</a></span></li> </ul> css: .libgc { background-color: #CCC; padding-top: 5px; padding-bottom: 5px; text-align: center; background-image: url(../images/pcnav.png); border: 1px solid #CCC; } jquery: $("li").click(function(){ $(this).css('background-image', 'url("images/btnSelectedTab.png")'); $(this).css('color','black'); }); }); Problem :

HTML link with padding and CSS style active does not work

两盒软妹~` 提交于 2019-12-05 05:57:23
HTML link with padding and CSS style active does not work in Google Chrome, Apple Safari, Opera, Mozilla Firefox. However, it works in Internet Explorer 8. Here is an example code. Try to click on Stack - link does not work, click on Overflow - link works. By works I mean - navigate to StackOverflow site. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>css active padding href problem</title> <style type="text/css"> a{ display: inline-block; background:#CCC; border:1px solid #666; padding:0 35px 0 0; } a:active{ padding:0 0 0 35px;

How do I scroll an overflowed div to a certain hashtag (anchor)?

被刻印的时光 ゝ 提交于 2019-12-05 04:11:19
On my webpage I have an overflowed div (i.e. with the vertical scrollbar). Inside the div, I have anchors with ids. When I put one of these ids in the URL (mypage.html#id), I want the div, not the page, to scroll to that anchor. How do I do that, preferably with plain JavaScript? If it's too complex, I'll go with jQuery, but I'm not using it in this project for anything else. $('.overflow').scrollTop($('#anchor').offset().top); There is no reason at all you can't convert this to standard javascript. Note that the scroll will be off if there is a margin on the anchor element. Have you tried to

Passing values to another php page using anchor tag

纵饮孤独 提交于 2019-12-05 03:40:35
问题 I try to pass value of PersonID from list.php to Delete.php. using anchor tag Here is my code : <A HREF = "Delete.php?PID = <?php echo $row['PersonID']; ?>"> Delete </A> The value is passed correctly but somehow I don't get redirected to Delete.php can anyone note the problem in the above line? 回答1: Get rid of the space in your URL: <a href="Delete.php?PID=<?php echo $row['PersonID']; ?>"> Delete </a> 回答2: Delete the spaces before and after the '=': <A HREF="Delete.php?PID=<?php echo $row[

Outline applied to an anchor containing an image isn't the right height in Chrome

烂漫一生 提交于 2019-12-05 02:28:10
问题 For a site I'm working on, I'd like to have a dotted outline appear around links when they are focused/hovered/active. I'd like this to happen for text and image links. The issue I have is that whilst my code works great in Firefox and IE, in Chrome 7.0.517.41 the dotted outline is the same height as my text, not the height of the image. Sample code: <!DOCTYPE html> <html lang="en"> <head> <style type="text/css"> BODY { font: 15px/1.5 sans-serif; } a:focus, a:hover, a:active { outline: 1px

Strange results with an empty href and the :link pseudo class

穿精又带淫゛_ 提交于 2019-12-05 01:44:13
Here is some really simple markup and CSS: a { color: red; } a:link { color: green; } <a href="#">one</a> <a href="">two</a> <a href>three</a> <a>four</a> FIDDLE Now from the spec : in HTML4, the link pseudo-classes apply to A elements with an "href" attribute. So i'd expect the first 3 links to be green. But no, the result is actually that only the first link that has a non-empty href is green. So I used inspect element and I saw that the a:link selector actually overides the a selector in all of the first 3 cases, but for some reason only applies the style on the first case. What is going on

how to get jquery anchor href value

大憨熊 提交于 2019-12-05 01:26:42
jQuery: $(document).ready(function() { $("a.change_status").click(function(){ var status_id = $("a").val(); alert(status_id); return false; }); }); HTML: <a href="?status=5" class="change_status">Aminul</a><br/> <a href="?status=25" class="change_status">Arif</a><br/> <a href="?status=15" class="change_status">Sharif</a><br/> I need status_id and for some reason my anchor tag is dynamic. I can't use id or make class name dynamic. I think, I need to use $this to get my value. This one is simple : $(document).ready(function() { $("a.change_status").click(function(){ var status_id = $(this).attr(

CSS: a:link vs just a (without the :link part)

你离开我真会死。 提交于 2019-12-05 01:25:31
So we're required to use the following order for CSS anchor pseudo-classes a:link { color: red } a:visited { color: blue } a:hover { color: yellow } a:active { color: lime } But my question is why bother with the a:link part? Rather, is there any advantage to the above (other than perhaps clarity) over: a { color:red; } /* notice no :link part */ a:visited { color: blue; } etc.,etc. :link selects unvisited links, that is: anchors with an href attribute which have not been visited by the browser (for whatever definition the browser vendor has for "visited"). If it has :link then it will never