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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to know the client OS?

Status
Not open for further replies.

sharansh123

Programmer
Nov 29, 2007
5
How can I detect the client operating system using javascript? I am using a component which works differently on xp and win2k machines. Right now the client has to select one of them. But Iwant to automate it.

Any help woul be appreciated.
Thanks in advance.
 
Typing "javascript detect os" into google produced lots of results with examples. I suggest you start there and read some of the articles.

If you get stuck, ask for help in the javascript forum.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
thanks for ur kind guidance but the stuff I am getting at google is windows/mac/apple/linux based whereas my reqiurement is to get differentated between different versions of windows like xp-win2k or above etc.

Any ideas!!
 
You can also do this with a server side language.

In PHP you would look at the contents of $_SERVER['HTTP_USER_AGENT'] or $_ENV['HTTP_USER_AGENT']

This is basically just looking at the string sent by the browser though so you get the same info via Javascript. It just might be more desirable to do the detection server side and return the correct version of the page rather than serve both versions and then have the client choose which to use.



--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
thanks Foamcow for your kind response
but I am using javascript with asp.net/C#
 
I used PHP as an example because it's what I know. You can almost certainly do the same thing with ASP.NET.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top