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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting Browser Type

Status
Not open for further replies.

Vakla

Programmer
Mar 29, 2001
2
US
Where I can find a script for detecting if someone is using /Netscape or Internet Explorer and then send the two to different sites?
 
I don't know much about this one but I remembered that I saw it somewhere. Hope it helps.

[sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
Hi Vakla,

I don't know if you can detect the browser type by using HTML or DHTML, but you can simply do it using javascript. Here is an example:


<html>
<head>
<title>Untitled</title>
</head>

<body>

<SCRIPT LANGUAGE=JAVASCRIPT TYPE=&quot;TEXT/JAVASCRIPT&quot;>

if (navigator.appName == &quot;Netscape&quot;) {
document.write(&quot;You're running Netscape Navigatorr.&quot;)
}
else {
document.write(&quot;You're not running Netscape Navigator.&quot;)
}

if (document.all) {
document.write(&quot;Yor are using IE&quot;)
}
else {
document.write(&quot;You are using NS&quot;)
}

</SCRIPT>

</body>
</html>

You probably also can combine those two conditions into one if...else if...else condition to detect other browser types that are neither IE nor NS.

Hope it help!

Shukui
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top