"javascript: void(0)" links sometimes break event handlers in internet explorer

Posted by internet man on Stack Overflow See other posts from Stack Overflow or by internet man
Published on 2010-05-19T19:07:00Z Indexed on 2010/05/19 19:10 UTC
Read the original article Hit count: 137

Filed under:
|

A while back I ran in to a problem where after clicking an anchor with "javascript: void(0)" events just stopped firing. I read that following a link puts the page in a different state and in that different state events don't fire. Even though the link is not real, it sometimes confuses IE. Anyway, I removed the "javascript: void(0)"'s and the problem has not been seen again.

Now, in a different application I am seeing the same thing... kinda. Clicking the "javascript: void(0)" sometimes has no ill effect. But then for some reason or another after clicking the bad link the page will stop working. Once this happens it will continue to happen consistently until the client machine is rebooted. After reboot, you are back to it sometimes happening. Crazy right? Reboot fixing a web page!?!?!

So, my question is has anyone seen this before? Can anyone give an explanation for this issue? Any documentation on this issue? I can't seem to find anything on it again. Does this even make sense?

I already know "javascript: void(0)" is bad practice... I am just looking to understand the issue. Specifically, this is IE7.

Thanks for reading!

© Stack Overflow or respective owner

Related posts about html

Related posts about internet-explorer