欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS利用cookies設(shè)置每隔24小時彈出框

 更新時間:2017年04月20日 14:15:27   作者:燦爾哈擦蘇  
這篇文章主要介紹了利用cookies設(shè)置每隔24小時彈出框的實例代碼,需要的朋友可以參考下

廢話不多說了,直接給大家貼代碼了,具體代碼如下所示:

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) { // 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; 
 } 
 //提示過期彈框 
 if({$remindflag} == "1"){ 
  setInterval(function TanChuang() { 
  var c = getCookie("cookievalue"); 
  if (c != null) { 
   return; 
  } 
  cookieGO("getcookie"); 
   G.alert({ 
    "title":"過期提示", 
    "pclass":"box", 
    "text":"您的錯題本服務(wù)將于"+"{$userinfo.member_end}"+"過期<br>為了不影響您的正常使用請續(xù)費", 
    "btnText":"購買續(xù)費", 
    "alert":function(){ 
     this._remove(); 
     window.location.href = "/manage/pay/readyopenvip.php"; 
    } 
   }); 
  },2000); 
 } 

以上所述是小編給大家介紹的利用cookies設(shè)置每隔24小時彈出框,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論