Problem with BrowserType object

Dave

Perch
I've managed to move my entire website over from another webhost in only a few hours and just about everything seems to be working great, although the site runs noticeably faster here. However, I've run into a small problem with an incorrect response being received from JodoHost's BrowserType control.

This is the code I'm using to detect the browser on the server side:

' browser sniffer
Set bc = Server.CreateObject("MSWC.BrowserType")
dim thisBrowser
dim thisBrowserVersion
thisBrowser = bc.browser
thisBrowserVersion = bc.version
set bc = Nothing


This works perfectly on the other webhost. Internet Explorer is identified as "IE", Netscape is identified as "Netscape", and Mozilla is identified as "Mozilla".

The same page on JodoHost identifies Internet Explorer as "Netscape" and both Mozilla and Netscape are identified as "Default".

The only thing different about the page is the server it resides on. No other changes have been made.

Any ideas???

Thanks,
Dave
 
Why do you say it's a "better option"? From my point of view, the only thing that makes it better is that it doesn't use the BrowserType control on your server, which, for some unexplained reason, doesn't function the way it's designed to.

The reason I am using the server-side control is so I can determine in advance what HTML and client-side javascript to send to the user so I can cut down the size of the page by not having to send everything to the user, including different include files, then make a decision about what the user can see and do. In addition to sending all code for different browsers, now I have to have the additional overhead of sending the client-side browser detection javascript. Putting everything on the client side probably doubles the size of the page.

In the end, if I'm forced to then I have no alternative but to go that route. But it definitely doesn't seem like the "better option".

Thanks for the reply anyway.
 
Have you tried using Request.ServerVariables to determine the browser? It should work fine. The problem with MSWC.BrowserType, is that it requires update to "browsercap.ini" (if I remember its name right) and restarting the server.
 
Thanks for the information, StPatrick. That explains why behaviour I was experiencing. My guess is that the BrowsCap.ini file hasn't modified from it's original version when it was installed. The documentation doesn't say anything about restarting the server, so maybe support will update the file (on a regular basis?).

I'll look into the servervariables approach. That might be a work-around. Thanks for the suggestion!
 
I made that suggestion because we couldn't determine why "BrowserType" wasn't pulling the correct information. We did some research and tried running some JavaScript code which pulled it perfectly. Anyway, StPatrick's post clarifies what was wrong and we'll be taking a closer look at Microsoft's KB next time.
 
I forgot to update everyone on this. The Browscap.ini already has the IE 6.0 information included in it.
 
Back
Top