Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1737 On Netscape 4.0 & 4.6 for the Mac resizing the window will break all of your hyperlinks' onClick actions

irt.org | Knowledge Base | JavaScript | Bugs | Q1737 [ previous next ]

Q1737 On Netscape 4.0 & 4.6 for the Mac resizing the window will break all of your hyperlinks' onClick actions

Mark Chrisman writes:

This is a netscape/mac bug & workaround. On Netscape 4.0 & 4.6 for the Mac (I didn't check earlier Netscape versions), resizing the window will break all of your hyperlinks' onClick actions. For example:

<a href="" onclick="my_fancy_function()">click</a>

Here's the workaround (looks stupid, but I'm not kidding, it works!):

window.onresize = function () {
  if (navigator.appName.indexOf('Netscape') != -1) {
    if (document.links.length>0) {
      document.links[0].onclick = document.links[0].onclick;
    }
  }
}

Interestingly, you don't need to iterate over all the links. Performing this meaningless action on document.links[0] will fix all the links.

I haven't tested the workaround in a document with layers or frames.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.