How to detect the operating system on the client machine ?

In order to detect the operating system on the client machine, your script can analyze the value of navigator.appVersion or navigator.userAgent.

Example:

// This script sets OSName variable as follows:
// "Windows" for all versions of Windows
// "MacOS" for all versions of Macintosh OS
// "Linux" for all versions of Linux
// "UNIX" for all other UNIX flavors
// "Unknown OS" indicates failure to detect the OS