更多"Try it Yourself"下面的例子。
定义和用法
该cookieEnabled属性返回一个布尔值,指定是否cookies在浏览器中启用。
有关cookie的更多信息,请阅读我们的JavaScript Cookies教程 。
浏览器支持
属性 | |||||
---|---|---|---|---|---|
cookieEnabled | 是 | 是 | 是 | 是 | 是 |
句法
navigator.cookieEnabled
技术细节
返回值: | 布尔值,指示是否cookies在浏览器中启用。 如果启用,则返回true,否则返回false |
---|

更多示例
例
在一个示例中,所有的导航性能的演示:
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>";
试一试» 