Check OS system?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Simma
Posts: 98
Joined: June 8th, 2010, 2:57 pm

Is there a way to check what operating system is used? I have found $.os, which kind of works, but it will give me a long name like "Microsoft Windows Vista Servicepack etc. I'm looking for something that can simply say if the os is Windows or MacOS. I guess I could split the string and check the first letters, but it feels like there would be a simple command. Anyone?
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Something like this should work:

var isWindows = $.os.indexOf("Windows") != -1;

Dan
Simma
Posts: 98
Joined: June 8th, 2010, 2:57 pm

Thanks Dan, that worked :).
Post Reply