PDA

View Full Version : browser redirecting


undyingfires
10-29-2002, 07:24 PM
<script>
<!--
/*By George Chiang (JK's JavaScript tutorial)
http://www.javascriptkit.com
Credit must stay intact for use*/

var n=navigator.appName
var ns=(n=="Netscape")
var ie=(n=="Microsoft Internet Explorer")
if (ns)
location="page1.htm"
else if (ie)
location="page2.htm"

//-->
</script>


I found this script to redirect a visitor to a page depending on their browser.
What about opera or other browser types?

chrismiceli
10-30-2002, 12:56 AM
if you have opera or "other browsers" you can find out what they would return for navigator.appName by this code


alert(navigator.appName)

run that in any browser to find out what their names are.