Navigator platform 属性
页面下方有更多实例。
定义和用法
platform 属性是一个只读的字符串,声明了运行浏览器的操作系统和(或)硬件平台。
虽然该属性没有标准的值集合,但它有些常用值,比如 "Win32"、"MacPPC" 以及 "Linuxi586",等等。
浏览器支持
属性 | |||||
---|---|---|---|---|---|
platform | Yes | Yes | Yes | Yes | Yes |
语法
navigator.platform
技术细节
返回值: | 字符串,表示浏览器的平台。 可能的值:
|
---|
更多实例
实例
在以下实例中演示了所有 navigator 导航器属性:
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>";
亲自试一试 »
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>";
❮ Navigator 对象