|
-
Jul 27th, 2000, 08:48 AM
#1
Thread Starter
Addicted Member
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>
-
Jul 27th, 2000, 12:14 PM
#2
Member
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
-
Mar 6th, 2002, 02:17 PM
#3
Frenzied Member
This code doesn't work for the version number. Please help, I really need this to work.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Mar 6th, 2002, 02:47 PM
#4
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?
-
Mar 6th, 2002, 02:58 PM
#5
Black Cat
Client side javascript:
Code:
document.location.href = 'somepage.html';
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|