js 循环 定时调用 判断时间>20:50或者<8:50跳转图一否则跳转2.3
//循环执行,每隔3分钟执行一次showalert() window.setInterval(showalert, 180000);
var REPORT_URL1='${servletURL}?viewlet=WorkBook1.frm&aa=1&bb=2';
var REPORT_URL2='${servletURL}?viewlet=WorkBook2.frm' ;
var REPORT_URL3='${servletURL}?viewlet=WorkBook3.frm' ;
function showalert() { var date=new Date();
var hour=date.getHours();
var min=date.getMinutes();
var aa=0
if(hour>20||hour<8){
window.open([(decodeURI(decodeURI(REPORT_URL1)))]);
} else if ((hour==20&&min>=50)||(hour==8&&min<=50)){
window.open([(decodeURI(decodeURI(REPORT_URL1)))]);
}else{
if(aa==0){
window.open([(decodeURI(decodeURI(REPORT_URL2)))]);
aa=1;
}else {
window.open([(decodeURI(decodeURI(REPORT_URL3)))]);
aa=0;
}
}
}