冰豆网

分享网络精彩
www.bingdou.com.cn

js弹窗代码24小时内只弹出一次

时间:2022-04-10加入收藏

<script language="JavaScript" type="text/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=600,height=800,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="https://fuli.qianqi.net";

setTimeout("TanChuang()",2000);
window.focus()
</script>

打 赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

TGA: 技巧

分享到:

官方微信二维码冰豆网官方微信公众号