Tutorial Test if Mac or PC with JavaScript
User Agent testing sucks, but sometimes you need it for subtle things. In my case I was using it to adjust what I was showing for keyboard s...
https://iskablogs.blogspot.com/2014/03/tutorial-test-if-mac-or-pc-with.html
User Agent testing sucks, but sometimes you need it for subtle things. In my case I was using it to adjust what I was showing for keyboard shortcut keys (Command or Control). Nothing super major.
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
$("body").addClass("mac");
} else {
$("body").addClass("pc");
}
The statements in there use jQuery to add a body class, but that's not
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
$("body").addClass("mac");
} else {
$("body").addClass("pc");
}
The statements in there use jQuery to add a body class, but that's not