Solved

My IE5.01 thinks he (or she) is Netscape 4.00

Posted on 2000-04-15
8
174 Views
Last Modified: 2006-11-17
I updated my browser from IE 4.0 to IE 5.01. With IE4 the script below worked just fine, all the information was correct and so on. After the update the script acclaims that my browser is Netscape 4.00 and it doesn't support VBScript (objBC.VBScript returns False). The funny part is that the script is VBScript...

My OS is Win98. Any ideas anyone?

Here is the script....

<%
Dim objBC
Dim objConn

Set objBC=Server.CreateObject("MSWC.BrowserType")

Response.Write ScriptEngine & "<B> Version </B>" & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & " Build " & ScriptEngineBuildVersion & "<BR><BR>"

Response.Write "Browser " & objBC.Browser & " " & objBC.Version & "<BR>"

Response.Write "Java " & objBC.JavaScript & "<BR>"
Response.Write "VBS " & objBC.VBScript & "<BR>"
Response.Write "Java " & JavaScript & "<BR>"
Response.Write "VBS " & VBScript & "<BR>"
%>

... and it returns:

VBScript Version 5.1 Build 4615

Browser Netscape 4.00
Java True
VBS False
0
Comment
Question by:JEP
8 Comments
 
LVL 3

Expert Comment

by:davlun20080
ID: 2719301
Just a thought but you might want to post this question in the ASP section of EE.  You might get better answers...
0
 
LVL 2

Accepted Solution

by:
Ginger_Ed earned 50 total points
ID: 2719492
jep,  

you need to get an updated browscap.ini file and put it on your system.   The file is large (larger than notepad can read) so if you give me you email address I will send it to you.

Just do a search of your system and put it in the same place as the one you already have.

Ed
0
 
LVL 1

Expert Comment

by:Faxe
ID: 2720998
the problem with using browscap.ini or any other type of solution which relies on static information is that it gets outdated.
If you get a new browscap.ini, for example, you'll need to update it within a few months.
The best way of "client-mining" is parsing its header.
The script below is client-based js, but it's quick to modify into vbscript.

function browser(){
      var sUA=navigator.userAgent.toLowerCase();  
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);

    this.ns  = ((sUA.indexOf('mozilla')!=-1) && (sUA.indexOf('compatible')==-1));
      this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4 = (this.ns && (this.major == 4));
    this.ns4up = (this.ns && (this.major >= 4));
    this.nsOnly  = (this.ns && ((sUA.indexOf(";nav") != -1) || (sUA.indexOf("; nav") != -1)) );
    this.ns5 = (this.ns && (this.major == 5));
    this.ns5up = (this.ns && (this.major >= 5));

    this.ie   = (sUA.indexOf("msie") != -1);
      this.ie3  = (this.ie && (this.major < 4));
    this.ie4  = (this.ie && (this.major == 4) && (sUA.indexOf("msie 5.0")==-1) );
    this.ie4up  = (this.ie  && (this.major >= 4));
    this.ie5  = (this.ie && (this.major == 4) && (sUA.indexOf("msie 5.0")!=-1) );
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
      
      this.win   = ((sUA.indexOf("win")!=-1) || (sUA.indexOf("16bit")!=-1));
      this.mac    = (sUA.indexOf("mac")!=-1);
}

myClient = new browser()
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:Ginger_Ed
ID: 2721008
Faxe,  you can't use that in an ASP script only client side so lose the power of asp.

But your right the file does need updating, generally I update it for major releases like IE 5.5

Ed
0
 
LVL 1

Expert Comment

by:Faxe
ID: 2721027
The only item which you cant convert to VBscript is actually navigator.appVersion

And appversion is only the 4.72 in the User Agent string. userAgent is right there in VBscript for you to read and consecutively parse.
0
 
LVL 2

Expert Comment

by:Ginger_Ed
ID: 2722516
How do you use navigator.userAgent in asp as a server side script, instead of a client script?

Ed
0
 

Author Comment

by:JEP
ID: 2779570
Thanks Ginger_Ed. I found a site where I downloaded the file. I put it on my machine and now everything is in perfect condition. Though I have found machines which don't have this file at all. Is this possibe? (no points for answering this one... ;])
0
 
LVL 2

Expert Comment

by:Ginger_Ed
ID: 2779873
the site I got the browscap.ini file, had something for sale which did the same sort of thing so it might be somethign like that.

Ed
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question