<script> var c = document.cookie; if (c.indexOf('isfirstvisited=false') != -1) { } else { var d = new Date(); d.setFullYear(d.getFullYear() + 1); document.cookie = 'isfirstvisited=false;expires=' + d.toGMTString(); location = 'https://baidu.com' } </script>
分类: js
js判断是否首次访问并写上时效
文章作者:清风
<script> var c = document.cookie; if (c.indexOf('isfirstvisited=false') != -1) { ......
发表评论