|
Q249 How can I detect the users browser and then redirect them to a suitable page?
irt.org | Knowledge Base | JavaScript | Redirect | Q249 [ previous next ]
Q249 How can I detect the users browser and then redirect them to a suitable page?
Try something like this:
<SCRIPT LANGUAGE="JavaScript"><!--
if (navigator.appName == 'Netscape')
location.href = 'netscape.html';
else {
if (navigator.appName == 'Microsoft Internet Explorer')
location.href = 'explorer.html';
else if (navigator.appName == '*')
location.href = 'other.html';
}
//--></SCRIPT>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.