jQuery Browser Detection Script

Events happening in the community are now at Drupal community events on www.drupal.org.
anthonyvz's picture

jQuery Browser Detection

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
Subscribe with RSS Syndicate content