[thelist] Browser Detect - IE6 = NN4?

aardvark roselli at earthlink.net
Sun Jan 13 02:05:48 CST 2002


> From: Ken Kogler <ken.kogler at curf.edu>
>
> http://www.kenkogler.com/browse.asp
[...]
>   <%
>     'Create an instance of the Browser Capabilities Component
>     Dim objBC
>     Set objBC = Server.CreateObject("MSWC.BrowserType")
>   %>
[...] 
> That's it. This is supposed to (among other things) detect my browser.
> I'm using IE6.0 under WinXP Pro, and this code tells me I'm running
> Netscape 4.00. 

erm, you're using the IIS software to determine the browser based 
on the browscap.ini file...

you need to do one of two things:

- update the browscap.ini file (try BrowserHawk from CyScape):
http://www.cyscape.com/products/
http://www.4guysfromrolla.com/webtech/062799-1.shtml

- rely on the HTTP User Agent string sent by the browser and 
parse on that:
<% = Request.ServerVariables("HTTP_USER_AGENT") %>

[...]
> Anybody know a better browser dectection method to separate the
> Netscape 4.X users? (I'm using this script to decide on a size for my
> <input> elements. NN4.x users get half the value of everyone else.)

instead of conditionalizing scripts, try using the HTML to set it as 
you want it for NN4.x, and then use a CSS file called via @import 
to override that for your N6/IE4+/Opera5+ browsers...

removes a whole hella lotta hassle...





More information about the thelist mailing list