Blaq
Joined: 27 Feb 2004 Posts: 45
|
Posted: Mon Mar 01, 2004 9:32 am Post subject: Browser Redirection Script |
|
|
Create a blank page, and add the following code to the <head> section of it:
<script>
//Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and Terms Of Use,
//visit dynamicdrive.com
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 6
if (browser_type=="Netscape"&&browser_version>=5)
window.location.replace("http://mozilla.org")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
window.location.replace("http://microsoft.com")
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("http://www.netscape.com")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://www.dynamicdrive.com"
</script>
This blank page will act as the browser redirector. Change the destinations inside the script from Netscape.com, Microsoft.com, and Geocities.com to others, depending on whether the user is using NS 4, NS 6+, IE 4, or none of the above, respectively. |
|