[thelist] JS to detect Mac
Liorean
Liorean at user.bip.net
Fri Feb 1 11:29:00 CST 2002
At 11:31 2002-02-01 -0500, aardvark wrote:
>anyone got a pretty simple piece of JS that can essentially detect
>if a user is on a Mac or not?
>
>i need to adjust an offset of a DHTML widget for a client, and they
>want client-side detection over server-side because they frequently
>save dynamic pages to floppies to take places... among other
>things...
var re=/mac/i;
var mac=re.test(navigator.platform);
// or, with a variable detection:
// var mac=typeof
navigator.platform!='undefined'?re.test(navigator.platform):false;
// Liorean
More information about the thelist
mailing list