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

Detect Operating system and forward to appropriate page

Status
Not open for further replies.

vancvanc

Technical User
Aug 12, 2002
2
CA
We are upgrading to Windows XP from W2K. We have a web app that is reached from a link on our main intranet page. When a W2K user clicks the link they should go to and when a WinXP user clicks the same link, they should go to
I have a feeling this should be kinda easy to code, but I am new at all this...

Thanks
 
The key is to use the [tt]navigator.userAgent[/tt] property as it contains the data about client's OS:

win2k = (navigator.userAgent.indexOf("Windows NT 5.0")>-1 )?1:0

then use it like this:

if (win2k)
{ // do something
}

Type javascript:navigator.userAgent in the address bar of your browser to get the value for WinXP and use it the same way.

But I think it's not so good idea. There are no such differences between win2k and XP that require different pages! It can make sence for separating users on Mac and Linux for example, but not for different Win versions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top