English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
platformA read-only property returns a string representing the browser platform (operating system).
This specification allows the browser to always return an empty string, so do not rely on this property for reliable answers.
navigator.platform
var x = navigator.platform; document.querySelector("#output").innerHTML = x;Test and See‹/›
All browsers fully support the platform property:
Property | |||||
platform | Yes | Yes | Yes | Yes | Yes |
Return Value: | A string used to identify the platform on which the browser is running. For example: "MacIntel", "Win32”,“ FreeBSD i386”,“ WebTV OS” |
---|
This example shows all Navigator properties:
var txt = ""; txt += "<p>Browser CodeName: " + navigator.appCodeName + "</p>"; txt += "<p>Browser Name: " + navigator.appName + "</p>"; txt += "<p>Browser Version: " + navigator.appVersion + "</p>"; txt += "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>"; txt += "<p>Browser Language: " + navigator.language + "</p>"; txt += "<p>Browser Online: " + navigator.onLine + "</p>"; txt += "<p>Platform: " + navigator.platform + "</p>"; txt += "<p>User-agent header: " + navigator.userAgent + "</p>"; document.write(txt);Test and See‹/›
Navigator Reference:navigator.appCodeName property
Navigator Reference:navigator.appname property
Navigator Reference:navigator.cookieEnabled property
Navigator Reference:navigator.language property
Navigator Reference:navigator.onLine property
Navigator Reference:navigator.userAgent property