The closest you can get is the application version, which partly matches the OS version - Safari isn't usually distributed separately, so you may be able to map Safari versions to the OS version it was released with.
I know how to detect the OS (e.g. Mac or Win) using navigator.userAgent, but I need a way to know the OSX "version" that the user is running.
7 replies
I don't hink there is a way. JavaScript is abstracted from the OS and I don't think that OS version is accessible.
The closest you can get is the application version, which partly matches the OS version - Safari isn't usually distributed separately, so you may be able to map Safari versions to the OS version it was released with.
The closest you can get is the application version, which partly matches the OS version - Safari isn't usually distributed separately, so you may be able to map Safari versions to the OS version it was released with.
You cannot detect the Mac OS X version directly through JavaScript; you can use
this information to determine whether they're using a PowerPC or Intel Mac. If a visitor is using Safari, you can estimate the Mac OS X version by
getting the browser's version and then using
this table to translate that.
(19662)
(19662)
What drugs are you on??
Java has the ability to provide specific and detailed OS information not to mention additional environment information so I suggest you take another look at the java API's before you make remarks like this.
Java has the ability to provide specific and detailed OS information not to mention additional environment information so I suggest you take another look at the java API's before you make remarks like this.
>What drugs are you on??
Apparently ones that let me read the original poster's question.
He's asking about JavaScript, not Java.
Other than the first 4 letters that match, there is no similarity between the two technologies. JavaScript runs in the browser and has limited exposure to anything outside of the browser.
Apparently ones that let me read the original poster's question.
He's asking about JavaScript, not Java.
Other than the first 4 letters that match, there is no similarity between the two technologies. JavaScript runs in the browser and has limited exposure to anything outside of the browser.
I was referning to JavaScript and yes JavaScript has the ability to perform complicated tasks and after all, it is a scripting language which has the ability to read environment variables so why can you not obtain it, even the browser has the ability to tell what the OS version is so why can this not be performed by his JavaScript?
Time is not a browser variable yet I have javascripts that interactively generate a real-time digital clock that continues to update after the page has completed performing it's task or are you implyingthat there are some exceptions to this rule and that obtaining the OS version is one of the exceptions.
Time is not a browser variable yet I have javascripts that interactively generate a real-time digital clock that continues to update after the page has completed performing it's task or are you implyingthat there are some exceptions to this rule and that obtaining the OS version is one of the exceptions.
Rather than battling this out, Dale, why not just show us the JavaScript that returns the OS Version 🙂
I tried this, but it only works in FF.
java.lang.System.getProperty('os.version')
java.lang.System.getProperty('os.version')
How can I detect the Mac OS version in JavaScript?