platform
Summary
Retrieves the name of the user’s operating system.
In IE10 and higher and WaterFox browsers this will return the bitness of the current tab. eg
Win32 or Win64.
Property of dom/Navigatordom/Navigator
Syntax
Note: This property is read-only.
var returnValue = navigator.platform;
Return Value
Returns an object of type StringString
HP-UX
HP UNIX-based computers.
MacPPC
Macintosh PowerPC-based computers.
Mac68K
Macintosh 68K-based computers.
SunOS
Solaris-based computers.
Win64
Windows 64-bit platform.
Win32
Windows 32-bit platform.
Win16
Windows 16-bit platform.
WinCE
Windows CE platform.
Examples
The external example enums the properties and methods of the navigator object of the client web browser and displays the results on the screen.
Usage
Could be used to feature test for support for x86 plugins or ActiveX controls.
To determine what bitness a web page is being rendered with, and subsequently the required bitness of any ActiveX controls it may be hosting type javascript:alert(navigator.platform); in the browser’s Address bar.
Syntax
var platform = navigator.platform
Related specifications
- DOM Navigator Platform
- Draft
Attributions
Mozilla Developer Network : [navigator.platform Article]
Microsoft Developer Network: [navigator.platform Article]