Solved

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

Posted on 2000-04-15
8
171 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

919 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now