Reacting to the users OS
-
I am using geocities to host my website, they offer an HTML editor. What I am trying to do is find out what OS the user is running, and load the page accordingly. In code it would look something like this: if the user is running Windows XP { Set the web page text to "You are running XP"; { else { Set the web page text to "Your are not running Windows XP"; } how would I go about doing this? Any help is appreciated:) -Dev578
-
I am using geocities to host my website, they offer an HTML editor. What I am trying to do is find out what OS the user is running, and load the page accordingly. In code it would look something like this: if the user is running Windows XP { Set the web page text to "You are running XP"; { else { Set the web page text to "Your are not running Windows XP"; } how would I go about doing this? Any help is appreciated:) -Dev578
To the best of my knowledge, no. The best you can do is determine that they are running "Win32", which is exposed in JavaScript as
navigator.platform
:<!-- details omitted... -->
function window_onload() {
window.alert(navigator.platform)
}<!-- details omitted... -->
<body onload="return window_onload()">
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
I am using geocities to host my website, they offer an HTML editor. What I am trying to do is find out what OS the user is running, and load the page accordingly. In code it would look something like this: if the user is running Windows XP { Set the web page text to "You are running XP"; { else { Set the web page text to "Your are not running Windows XP"; } how would I go about doing this? Any help is appreciated:) -Dev578
-
I am using geocities to host my website, they offer an HTML editor. What I am trying to do is find out what OS the user is running, and load the page accordingly. In code it would look something like this: if the user is running Windows XP { Set the web page text to "You are running XP"; { else { Set the web page text to "Your are not running Windows XP"; } how would I go about doing this? Any help is appreciated:) -Dev578
The previous, anonymous post would be correct, assuming you have the ability to write server-side code in something (PHP,ASP,ASP.NET,etc); however, given your example, I assumed that you don't have that capability, and are limited to JavaScript. It might be feasible to do something with a Java Applet, but of course, that only works for users of your site with Java Runtime Environment installed. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.