Auto Answer FaceTime Call | When FaceTime was introduced by Apple the first time, I was thinking, it can be ...

Fix the bug of ANCHOR not working in IE

February 23rd, 2009 by Tkjune

Broken anchor in IE
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:

  1. <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:

  1. <div><a name="anything">&nbsp;</a></div>

17 Responses to “Fix the bug of ANCHOR not working in IE”

  1. Awais Says:

    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

  2. Tkjune Says:

    @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..

  3. Agustín Says:

    thanks a lot! this really helped me out!

    muchas gracias! esto solucionó mi problema!

  4. Tom Says:

    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.

  5. Tkjune Says:

    @Tom Glad to be of help~

  6. John Says:

    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.

  7. Ali Says:

    thanks mate ! Works fine.

  8. Tkjune Says:

    @Ali Nice:)

  9. Tkjune Says:

    @John Thx~ helpful tips for me

  10. Tkjune Says:

    @Ali BTW, r u from AU?:)

  11. Veals Says:

    Great thought!
    Keep it up

  12. Farman Says:

    Nice post.
    Well done!

  13. Paul Says:

    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.

  14. Paul Says:

    Within js script tags:

    if (window.location.hash)
    window.location = window.location.hash;

  15. Tkjune Says:

    @Paul Thx for ur tip. I'll try it out later.

  16. Monique Says:

    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!!

  17. Monique Says:

    In the 2nd line you should read: ...go to the 1st div which is div id="website".

Leave a Reply

You must be logged in to post a comment.