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

Q83 How do I detect the version of JavaScript the users browser supports, and then divert them to an appropriate page?

irt.org | Knowledge Base | JavaScript | General | Q83 [ previous next ]

Q83 How do I detect the version of JavaScript the users browser supports, and then divert them to an appropriate page?

<script language="JavaScript"><!--
var browser = navigator.appName;
var version = navigator.appVersion;

if (browser == 'Microsoft Internet Explorer') {
    if (version.indexOf('Internet Explorer 4') != -1)
        location.href = 'ms4.html';
    if (version.indexOf('Internet Explorer 3') != -1)
        location.href = 'ms3.html';
    else
        location.href = 'default.html';
}
else if (browser == 'Netscape') {
    if (parseInt(version) == 4)
        location.href = 'nn4.html';
    if (parseInt(version) == 3)
        location.href = 'nn3.html';
    if (parseInt(version) == 2)
        location.href = 'nn2.html';
    else
        location.href = 'default.html';
}
//--></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.