Click to See Complete Forum and Search --> : How to check for browser type
Moonlord
04-15-2003, 10:33 PM
Does anyone know how to check for the browser type of the site visitor? I got a lot of IE specified stuff on my page and want to make sure that my visitors get the full experience.
And some don't have IE so nearly half of the site doesn't work for them.
I need a script that checks the browser type and decides:
page 1 for IE and page 2 for anything else.
Thanks in advance, Moonlord.:)
Cross posted: http://forums.webdeveloper.com/showthread.php?s=&threadid=7905
http://brothercake.com/scripts/sniffer.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
NOTE: place your sniffer code here or a link to 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
//if NS 6
if (ns6)
window.location.replace("http://www.yoursite.com/ns6.html")
//if IE 4+
else if (ie4)
window.location.replace("http://www.www.yoursite.com/ie4.html")
//if NS4+
else if (ns4)
window.location.replace("http://www.www.yoursite.com/ns4.html")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://www.yoursite.com/ie.html"
</script>
</HEAD>
<BODY>
</BODY>
</HTML>