jQuery Browser Detection
Posted by anthonyvz on January 27, 2009 at 2:50pm
Hey Everyone,
Here's the jQuery to detect browser version. This one would look for Internet Explorer 6 and add a css style to "SOME-UNIQUE-ID"
if (jQuery.browser.msie) {
if(parseInt(jQuery.browser.version) == 6) {
$('#SOME-UNIQUE-ID').css('property','value');
}
}
It will detect;
* safari
* opera
* msie
* mozilla
Hopefully you can put that to use. I'm in the process of trying to get it to detect if the user is on an iPhone or not.
Cheers,
Anthony
Read more