Saturday, November 26, 2011

jquery detect os (Operating system)

The best way to detect a Operating system using JQuery. You can easily detect whether you are on linux or mac or window operating system.
$(‘#osInfo’).html(“Your OS is: ” + $.client.os + “”);
//To detect Mac OS:
if((navigator.platform.indexOf(“Mac”) != -1)) {
// code
}
$.browser.linux();
$.browser.mac();
$.browser.win();

No comments: