- var dt = new Date();
- dt.setSeconds(dt.getSeconds() + 60);
- document.cookie = "cookietest=1; expires=" + dt.toGMTString();
- var cookiesEnabled = document.cookie.indexOf("cookietest=") != -1;
- if(!cookiesEnabled) {
- // 未启用
- }
- //该片段来自于http://www.codesnippet.cn/detail/29112012730.html
来源: http://www.codesnippet.cn/detail/29112012730.html