navigator.platform
JavaScript 1.2+, JScript 1.0+ Nav4+, IE 4+ Syntax
navigator.platform
Description
The platform property of the navigator object returns a string representing the platform on which the browser is running. Valid platform values are: Win32, Win16, Mac68k, and MacPPC. There are also various values for UNIX platforms.
Example
Listing 7.402 shows an example of how the platform property is used.
Listing 7.402 Example of the platform Property
<html> <head> <title> Example of the platform property of the navigator object</title> </head> <body> <script language="JavaScript"> <!--Hide // output the navigator platform property document.write(navigator.platform); // End Hide --> </script> </body> </html> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.