The application-version object navigator.platform (Figure 13.1) identifies the operating system of the browser used to view the site, although it's embedded in a string of other information (Figures 13.2 and 13.3). This information can be very useful, especially if you need to overcome font-size inconsistencies, or other OS-related incompatibilities. Figure 13.1. The general syntax for the platform object.
Figure 13.2. The code is being run in Windows.
Figure 13.3. The same code is being run on a Mac.
To detect the operating system being used:
|