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

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

You are here: irt.org | FAQ | JavaScript | General | Q83 [ previous next ]

<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>

©2018 Martin Webb