利用localStorage判断程序首次运行

复制代码
<script type="text/javascript">
if (localStorage.pagecount)
  {
  localStorage.pagecount=Number(localStorage.pagecount) +1;
  }
else
  {
  localStorage.pagecount=1;
  }
if (localStorage.pagecount == 1)
  {
window.location.href="home.html";  //引导页页面
} else { window.location.href="home.html"//首页 } </script>
复制代码

 

posted @   忆殇之痕  阅读(255)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示