Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q361 How can I change the effect of a link tag so that Netscape and Explorer go to different locations?

You are here: irt.org | FAQ | JavaScript | Link | Q361 [ previous next ]

Try the following which goes to netscape.htm is Netscape Navigator is being used, explorer.htm if Microsoft Internet Explorer, and default.htm if the browser doesn't support JavaScript, or if JavaScript is disabled:

<A HREF="default.htm" onClick="if (navigator.appName == 'Netscape') this.href = 'netscape.htm'; else this.href = 'explorer.htm'">Go Somewhere</A>

©2018 Martin Webb