We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Code to check web Browser.

eteran asked
Medium Priority
Last Modified: 2008-03-10
Is there a code that can check which webbrowser the computer is useing
Watch Question

you can do:


so therefore:

document.write "You are using: " & Request.ServerVariables("HTTP_USER_AGENT")

Good Luck
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


okay now my question to you is how do I make it check the version
HTTP_USER_AGENT should contain the Version number as well.

Here is the code

    myUA = Request.ServerVariables("http_user_agent")
    ua = lcase(myUA)
    ie4 = instr(ua,"msie 4")
    ie5 = instr(ua,"msie 5")
    ie6 = instr(ua,"msie 6")

    if ie4>0 or ie5>0 or ie6> 0 then  ' It is IE 4 or IE 5 or IE 6
    'IE Code  


<%end if%>

  'Create an instance of the Browser Capabilities Component
  Dim objBC
  Set objBC = Server.CreateObject("MSWC.BrowserType")
<b>Your browser:</b> <%=objBC.Browser%><br>
<b>Browser version:</b> <%=objBC.Version%><br>
<b>Support Frames?</B> <%=objBC.Frames%><br>

to use this object, make sure you have your Browscap.ini updated, otherwise it can't detectIE6.0


that is the link to add IE 6 support the Browscap.ini file
Here's one of the best javascript examples to get detailed version info (or if you need to check the version client-side):


Also http://webreference.com/tools/browser/javascript.html to be used with: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.