This object provides detailed information about the current browser, including its name and possibly the build number and even operating system. The sample output we got from our copies of the Windows NT 4.0 version of Internet Explorer 3.01 and Netscape Navigator 3.01 are outlined in the table below:
Property | Value |
|
Mozilla |
|
Microsoft Internet Explorer |
|
2.0 (compatible; MSIE 3.01; Windows NT) |
|
Mozilla/2.0 (compatible; MSIE 3.01; Windows NT) |
Property | Value |
|
Mozilla |
|
Netscape |
|
3.01 (WinNT; I) |
|
Mozilla/3.01 (WinNT; I) |
You’ll probably notice a few things about these results. Firstly, the
property is the same as if we'd examined userAgent
on the server with ASP code. Secondly, the Request.ServerVariables(HTTP_USER_AGENT)
property is the concatenation of the userAgent
and appCodeName
properties. Thirdly, the odd names and divisions for these properties. Don’t spend too much time thinking about it— it’s what Netscape came up with when they wrote Navigator 2.0. Some of the original developers of Navigator also worked on Mosaic—the browser that started it all. They wanted Navigator to be a gorilla that would stomp all over Mosaic, hence the name.appVersion
So, if we’d like to take some action on the client depending on the exact browser version that someone viewing our pages is using, the
object is the way to go. To do the same thing on the server with ASP, we can use either the Navigator
header, or the more capable and powerful Browser Capabilities component.HTTP_USER_AGENT