Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page redirects depending on Browser type and version

Status
Not open for further replies.

lmarshall

MIS
Jun 11, 2002
108
US
I created a web page that has dropdown menus that were created using Fireworks. Does anyone know which browsers and versions support these drop down menus? Also does anyone know where I can get a script that distinguishes what browser and it version so that I can have the user be redirected depending on if their browser and version. I have pages for IE, Net, and Other (non-drop down menu site)

thanks
 
it comes with DW:
CODE-->Snippets--->Javascripts--->Browser Functions-->....

=================================================
<script>
------------------
function browserVer4Detect()
{
if(navigator.appVersion.substring(0,1) < 4)
URLStr = &quot;1.html&quot;;
else
URLStr = &quot;2.html&quot;;
window.location = URLStr;
}
-------------------
function platformDetect()
{
if(navigator.appVersion.indexOf(&quot;Win&quot;) != -1)
{
alert(&quot;Windows&quot;);
}
else if(navigator.appVersion.indexOf(&quot;Mac&quot;) != -1)
{
alert(&quot;Macintosh&quot;);
}
else alert(&quot;Other&quot;);
}
---------------------
// Example:
// var b = new BrowserInfo();
// alert(b.version);
function BrowserInfo()
{
this.name = navigator.appName;
this.codename = navigator.appCodeName;
this.version = navigator.appVersion.substring(0,4);
this.platform = navigator.platform;
this.javaEnabled = navigator.javaEnabled();
this.screenWidth = screen.width;
this.screenHeight = screen.height;
}
------------------------------

<!--
function sizeRedirect()
{
var wide = window.screen.width;

if(wide = 800) URLStr = &quot;1.html&quot;;
else URLStr = &quot;2.html&quot;;
location = URLStr;
}
//-->
-------------------------------------
</script>
</head>
<body onLoad=&quot;ANY_FUNCTION_NAME_ABOVE_THAT_YOU_LIKE()&quot;>

==============================================

there u go...mix and match for whatever version/need u have
All the best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top