...

View Full Version : OS detection script



hrisula
09-25-2003, 02:19 PM
Hi everybody,

I am looking for a script that will detect the user's os system, specifically detect if the user is using a Mac or a PC. Then, according to the os, it will direct them to the appropriate web pages. Anybody knows where I can find such a script? I made a search, and I found scripts that detect the browser only, could not find anything about the os.

Thanking you i8n advance

Hrisula

glenngv
09-25-2003, 02:23 PM
var os = navigator.platform.toLowerCase();
var mac = (os.indexOf("mac")!=-1) ? true:false;
var win = (os.indexOf("win")!=-1) ? true:false;

hrisula
09-25-2003, 02:31 PM
Thank you so much Glenn.

I appreciate your help
Hrisula

hrisula
09-25-2003, 02:38 PM
One other quick question... just to make sure I get it correctly.

Am I to understand that I name my files, in this example mac.htm and win.htm ?
And I make these modifications to the script
(os.indexOf("mac.htm")
(os.indexOf("win.htm")

Thanks again

hrisula
09-25-2003, 04:42 PM
PLease, somebody...

I just can't make it work, the mechanism escapes me
Can you give me some clues?

Presently I have an index file (index.htm) which is the same for all. Then users will have to be channeled to the appropriate Mac or PC pages (say mac.htm & win.htm. How will that happen

Have I got it all wrong???

hrisula
09-25-2003, 07:43 PM
IT's OK now, I managed
Thanks anyway



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum