Fix the bug of ANCHOR not working in IE
February 23rd, 2009 by Tkjune

ANCHOR may not work in IE when it's working fine with Firefox. Check the HTML code to see if the ANCHOR is written in this way:
- <div><a name="anything"></a></div>
Then it can not work in IE. Don't know why. Maybe another bug?
Note that there's nothing in the ANCHOR tag. Here's how to fix it: Simply add something even a space in it. For example like this:
- <div><a name="anything"> </a></div>
August 18th, 2009 at 3:29 am
echo "
";
see this code anchor not working not space only the whole image is loading there but anchor not working i don't whats wrong,...reply me if you can help me will be thankful
Awaisakhtar@yahoo.com please mail
August 22nd, 2009 at 7:49 pm
@Awais: I wrote mail to you but the mail was rejected. Would you check if it's correct? I cannot see the code you wrote after echo here..
December 30th, 2009 at 9:51 pm
thanks a lot! this really helped me out!
muchas gracias! esto solucionó mi problema!
March 24th, 2010 at 9:21 pm
I didn't know about this IE problem - it came as quite a shock. I found your fix via a Google search, thanks for helping me fix my issue quickly.
March 29th, 2010 at 3:35 pm
@Tom Glad to be of help~
October 7th, 2010 at 6:39 pm
After many hours of trying to sort out anchor code issues between browsers especially Internet Explorer, I have managed to solve this problem. I found that to solve this problem especially when using tables or nested tables is that the anchor tag cannot be placed in a cell on its own, it has to be placed immediately before text a graphic a horizontal line etc but NOT on its own. This has worked for me across all browsers.
November 22nd, 2010 at 6:49 am
thanks mate ! Works fine.
December 19th, 2010 at 11:24 am
@Ali Nice:)
December 19th, 2010 at 11:31 am
@John Thx~ helpful tips for me
December 19th, 2010 at 11:32 am
@Ali BTW, r u from AU?:)
January 17th, 2011 at 3:52 am
Great thought!
Keep it up
April 21st, 2011 at 9:38 pm
Nice post.
Well done!
August 24th, 2011 at 10:21 am
After spending a large amount of time with this and trying everyone's different hacks with inconsistent results I added this to the bottom of my html page:
// fix IE bug where hash anchors don't update scrolltop on some occasions
if (window.location.hash)
window.location = window.location.hash;
I had a unique requirement where I had an email with anchor links jumping to an anchor on my site.
August 24th, 2011 at 10:22 am
Within js script tags:
if (window.location.hash)
window.location = window.location.hash;
August 25th, 2011 at 1:10 am
@Paul Thx for ur tip. I'll try it out later.
October 10th, 2011 at 10:59 pm
On a website I built (see http://www.depeppelenbosch.nl), I have also made a top link "naar boven" which should go to the 1st . This works on all browsers except IE9 (yes, IE 8 and 7 work well).
What happens in IE9 is that you see the page first goes up to the top, but then in a split second the browsers goes to the top of the HOME-page. So it doesn't work for all subpages op the site.
This seems a very strange problem to me... ;-(
Does someone know how to solve that?
Thanks in advance!!
October 10th, 2011 at 11:00 pm
In the 2nd line you should read: ...go to the 1st div which is div id="website".