Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q258 When attempting to detect for Internet Explorer 3 using parseFloat(navigator.appVersion) it always returns 2, why, and what can I do about it?

You are here: irt.org | FAQ | JavaScript | Number | Q258 [ previous next ]

When Microsoft released Internet Explorer 3, they wanted it to appear as if it was the same version as being used by the then comparable Netscape Navigator 2. This is why Internet Explorer 3 fakes version 2 of Netscape Navigator.

To check for Internet Explorer 3 use:

<SCRIPT LANGUAGE="JavaScript"><!--
if (navigator.appVersion.indexOf('MSIE 3') > -1)
    alert('You are using Microsoft Internet Explorer version 3');
//--></SCRIPT>

However, if all your checking for is to see whether the browser supports the JavaScript image object then use the following instead:

<SCRIPT LANGUAGE="JavaScript"><!--
if (document.images) {
    // place image swapping code in here
}
//--></SCRIPT>

©2018 Martin Webb