您好!欢迎来到创咯网

创咯网

热门搜索:

js实现一个ip在24小时只弹出一次的弹窗代码

分类:团啊学院 时间:2019-04-21 21:11 浏览:1060
阿里云
资讯详情页摘要上方横幅-820*100
概述
js实现一个ip在24小时只弹出一次的弹窗代码
内容

<script language="javascript"> 

function cookieGO(name) {

  var today = new Date();

  var expires = new Date();

  expires.setTime(today.getTime() + 1000*60*60*24);

  setCookie("cookievalue", name, expires);

}


function setCookie(name, value, expire) {   

  window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));

}


function getCookie(Name) {   

   var findcookie = Name + "=";

   if (window.document.cookie.length > 0) { // if there are any cookies

     offset = window.document.cookie.indexOf(findcookie);

  if (offset != -1) { // if cookie exists

       offset += findcookie.length;          // set index of beginning of value

    end = window.document.cookie.indexOf(";", offset)          // set index of end of cookie value

    if (end == -1)

      end = window.document.cookie.length;

    return unescape(window.document.cookie.substring(offset, end));

     }

   }

   return null;

}


function TanChuang() {

  var c = getCookie("cookievalue");

  //alert(c);

  if (c != null) {

    return;

  }

  cookieGO("getcookie");

  

  /**var featureStr="''";

  featureStr="'top=0,left=0,width=800,height=600,toolbar=yes, menubar=no, scrollbars=no, resizable=no, location=no, status=no,center:no'";

  self.focus();

  var ExitWindow = window.open(exitURL,'', featureStr);

  ExitWindow.focus();**/

    window.location.href = exitURL;

  

}

var exitURL="你的网址";


setTimeout("TanChuang()",2000);

window.focus()

</script> 


评论
阿里云
联系我们
底部广告
阿里云
联系客服
网站客服 联系客服
手机版

扫一扫进手机版
返回顶部