我试图制作一个脚本,每5秒钟重复一次。
The script that will be repeated will check to see if a cookie exists.
If the cookie does not exist, the page is redirected.
If the cookie does exist, nothing happens.
饼干很好,我唯一的问题就是它不重复!
我用jQuery来识别/检查饼干,这很好。
我想知道密码有什么问题
I have looked online many times, but have had no luck in finding what I need.
This is the cookie plugin I use: https://github.com/carhartl/jquery-cookie
var checkcookie = $.cookie( myCookie );
checklogin();
function checklogin(){
setTimeout(function(){
if(checkcookie == null){
//if cookie not set
window.location.href= / ;
}
else{
//if cookie set
}
}, 5000);
checklogin();//to recall the script after it is done
}
或者如果有人有其他方法 检查饼干是否变了,我想知道!