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

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?

irt.org | Knowledge Base | JavaScript | Number | Q258 [ previous next ]

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?

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>

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.