|
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>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.