ALEFHOST.COM an Ecohosts.com company

 Reliable Web Hosting - Dedicated Servers - Ecommerce - Domain Registration - Web Design - (+972) 2-996-0794

 
 

Knowledge Base Article


Javascript Redirect Tutorial & Example

Redirect

Here is an example of a Javascript Redirect script, which redirects according to browser type:

<html>

<head>

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

</head>

</html>

Back to Knowledge Base
 

Copyright © 2002 - 2006 Alefhost.com Web Hosting Services. All Rights Reserved. WebDesign by Belindissima.com © 2006