大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 网页设计 -> 网页特效 -> 初学Javascript之cookie篇(3)

初学Javascript之cookie篇(3)

时间: 2021-07-31 作者:daque

  <html>  <head>  <title>homepage</title>  </head>  <body>  <a href='http://www.thehungersite.com/'>manual redirection<br></a>  <a href="javascript:resetcookie()">cookie reset</a>

  <script language="javascript">  <!--   var bvisitedtoday = false;

  var lastvisit = getcookie("lastvisit");  if (lastvisit != null)   {  lastvisit = 1 * lastvisit;  var lasthere = new date(lastvisit);    var rightnow = new date();

  if(lasthere.getyear() == rightnow.getyear()     && lasthere.getmonth() == rightnow.getmonth()     && lasthere.getdate() == rightnow.getdate())  {     bvisitedtoday = true;    }  }

  if(bvisitedtoday == false)  {  setlastlastvisitcookie();  window.location="http://www.thehungersite.com/"  }  else  {  //window.location="about:blank"  }

  function getcookieval (offset)  {  var endstr = document.cookie.indexof (";", offset);  if (endstr == -1)    endstr = document.cookie.length;  return unescape(document.cookie.substring(offset, endstr));  }  function getcookie (name)

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.