访问者浏览器中是否启用 cookie?
- <!DOCTYPE html>
- <html>
- <body>
- <h1>Navigator 对象</h1>
- <p>如果启用了 cookie,则 cookieEnabled 属性返回 true:</p>
- <p id="demo"></p>
- <script>
- document.getElementById("demo").innerHTML =
- "navigator.cookieEnabled 是:" + navigator.cookieEnabled;
- </script>
- </body>
- </html>