jQuery(document).ready(function () {
console.log(navigator.appVersion);
}
jQuery(document).ready(function () {
var OSName = "Unknown OS";
if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
else if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
else if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
else if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";
console.log('Your OS is: ' + OSName);
}
Both of the above code will work..