PDA

Click to See Complete Forum and Search --> : Browser Detection Redirect ?


nmretd
Jul 27th, 2000, 08:48 AM
I am using the following code to detect the user's browser. This works fine However, how can I adapt it so that it fires off a certain html page once it has determined that the browser is IE ?

<HTML>
<HEAD>

<script language="JavaScript">

<!-- hide me

function browserSizeUp()

{
var browser = navigator.appName;
var version = versionNumber();
var the_string = browser + " " + version;

if (browser == "Netscape")

{
alert("Your Browser is Netscape, version " + version);

} else {

alert("Your Browser is Internet Explorer, version " + version);
}
}

function versionNumber() {

// return version number (e.g., 4.03)

return parseFloat(navigator.appVersion)

}

// show me -->

</script>

<BODY ONLOAD="browserSizeUp()">

</BODY>
</HEAD>
</HTML>

spyder
Jul 27th, 2000, 12:14 PM
If your Server lets you use ASP use the response.redirect method to call the correct page.

java code...
{
<%response.redirect http://someplace/IE.htm%>
}

else

{
<%response.redirect http://someplace/netscape.htm%>
}


That there should work

seoptimizer2001
Mar 6th, 2002, 01:17 PM
This code doesn't work for the version number. Please help, I really need this to work.

mendhak
Mar 6th, 2002, 01:47 PM
Originally posted by nmretd
This works fine However, how can I adapt it so that it fires off a certain html page once it has determined that the browser is IE ?



didnt u just do that?

JoshT
Mar 6th, 2002, 01:58 PM
Client side javascript:
document.location.href = 'somepage.html';