Using The Browser Capabilities Component
What's the Browser Capabilities Component? It's used to figure out what type of browser and different properties the users browser supports.
To see if a users browser supports JavaScript, use the following code:
|
<%
Dim objBrowserCom
Set objBrowserCom = Server.CreateObject("MSWC.BrowserType")
If objBrowserCom.JavaScript Then
Response.Write "This browser supports JavaScript!"
End If
Set objBrowserCom = Nothing
%> |
The Browser Capabilities Component also supports these methods:
Browser Name - (.Browser) Returns a string
Browser Version - (.Version) Returns a string
Check to see if the browser supports frames - (.Frames) Returns a boolean value of true or false
Check to see if the browser supports tables - (.tables) Returns a boolean value of true or false
Check to see if the browser supports background sound - (.BackGroundSounds) Returns a boolean value of true or false
Check to see if the browser supports VBScript - (.VBScript) Returns a boolean value of true or false