您的位置:首页 > 其它

定时的页面提醒window.setInterval

2012-12-12 16:22 288 查看
<script type="text/javascript" language="javascript">
function GetNewTask()
{
var NewTaskData;
var NewHttp = new ActiveXObject("MSXML2.XMLHTTP");
NewHttp.onreadystatechange = function()
{
if(NewHttp.readyState==4)
{
if(NewHttp.status==200)
{
NewTaskData = NewHttp.responseText;

if (NewTaskData == "1")
{
window.open('NewGZRW.aspx', 'PopupWindow', 'width=250,height=150,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,titlebar=no,top=' + (window.screen.height-200) + ',right='+ (window.screen.width) +"'");
}
}
}
}

NewHttp.open("POST","GZRWAlert.aspx",true);
NewHttp.send();
}

window.setInterval("location.reload()",30000); //每五分钟刷一次
window.setInterval(GetNewTask ,12000); //每二分钟执行GetNewTask方法:页面提醒
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: