Ri**@nospam.com wrote:
A while ago I found a script that was able to redirect a user based on the
version OS. At the time I only needed to detect NT4 vs Win2k/XP. Here is
the script:
<script>
var n = navigator;
var ua = ' ' + n.userAgent.toLowerCase();
// find windows platform
var is_win = ua.indexOf('win') > 0;
var is_winnt4 = (ua.indexOf('nt 4.0') > 0 && ua.indexOf('win') > 0);
if(is_winnt4){document.location = "wm_player_framesetnt.html"}
else {document.location = "wm_player_framesetxp.html"}
</script>
This is why I thought it was possible to also detect Win2k vs XP.
The user agent string for IE on the machine that I'm using at the moment
comes up as:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
You work it out[1]. :-)
I think as VK says, you need to reverse engineer it. Every time you get
a user agent string you can't decipher or haven't come across before,
visit the machine, find out what it's running and add it to your
user-agent-deciphering routine.
But it will only work if you can control what the UA string is (the sys
admins at some places I work do, but not all). How do you know someone
isn't running some other browser/UA and putting whatever in the UA string?
1. XP Pro SP 1
--
Rob