Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to Detect client OS

Status
Not open for further replies.

sharansh123

Programmer
Nov 29, 2007
5
0
0
Is anybody there to tell me how to identify client's os, ie differentiate between 98/xp/win2k/win3k as in my application the has to choose this and i want it to automated at pageload.
 
You want to use the navigator.userAgent option.

Code:
var UserOp;
if((navigator.userAgent.indexOf('Win') != -1) &&
 (navigator.userAgent.indexOf('XP') != -1)){

UserOp = "Windows XP"
}

and so on...

Cheers

Nick
 
In IE, you also have access to "window.clientInformation.platform", "window.navigator.platform", and "window.navigator.cpuClass" which provide some extra info:



Dan




Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top