The code here is a lightweight object that I use on my big sites to let me access client side all the main browser settings for the current user. I include it globally on all pages and its one of the first pieces of code that runs setting up lots of useful properties such as:Browser Name, Version, Operating System, Script Support, Flash Support, Rendering Engine. An example is below:
Your Browser Details are:
Include a reference to the script in your page which you can download here.
Then just reference the properties you wish to check as and when you need them:
Browser.name //get name of browser
Browser.gecko //whether browser uses the gecko rendering engine
Browser.flashEnabled //Browser supports flash
Browser.ie //Browser is Internet Explorer
And many more useful properties that detail the users browser settings. N.B I have a property called
Browser.AJAXEnabled that will show up as undefined on this page. In my system I set this value on the first function call that requires use of an XMLHTTP object. This function is not included in this script but it would be pretty simple to tie it into your own custon code. If the majority of your pages don't make use of AJAX calls then there is little point in testing for it along with the other browser tests this object does on every page load.
To output all the current settings for the browser object call the Settings() method which will loop through all properties appending them to a string for display purposes e.g:
document.getElementById("BrowserSettings").innerHTML = Browser.Settings();