Detecting Netscape





2
Date Submitted Fri. Aug. 25th, 2006 4:13 AM
Revision 1 of 1
Helper Cyber-Drugs
Tags agt | indexOf
Comments 0 comments
Ever noticed that with the new Netscape, which allows you to view your pages in FireFox or IE Display mode, when in IE mode:

navigator.appName

Thinks Internet Explorer is actually being run, rather than Netscape?

Well below is the code you need to get around this problem.

<script type="text/javascript">
var agt = navigator.userAgent.toLowerCase();
var browser = agt.indexOf('netscape');
if (browser != -1){
  alert("You are using netscape.");
}
</script>
 

Justin Nel

Comments

There are currently no comments for this snippet.

Voting