您的位置:首页 > Web前端 > JavaScript

OA里面定时提醒功能实现

2010-09-21 17:06 411 查看
通过定时器弹出提示窗口,很多OA有这种功能
<script>
function openWindow(win,winTitle,winWidth,winHeight)
{
var winleft=window.screen.width-winWidth-12;
var winTop=window.screen.height-winHeight-75;
window.open(win ,winTitle,'width='+ winWidth +'px,height='+ winHeight +'px,left='+ winleft +'px,top='+ winTop +'px,scrollbars=1,status=0');
}
</script>
<script language="javascript" type="text/javascript" src="../js/Ajax.js"> </script>
<script language="javascript" type="text/javascript">
function check(typeStr)
{
var myurl="Tip.aspx?type="+typeStr;
var MyWebSend="";
xmlHttp.open("POST",myurl,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = ValidateCallBack;
xmlHttp.send(MyWebSend);
}
function checkNormal()
{
check('normal');
window.setTimeout("checkNormal()",60000);
}
function checkCalendar()
{
check('calendar');
window.setTimeout("checkCalendar()",1200000);
}
function ValidateCallBack()
{
if (xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
var result=xmlHttp.responseText;
if(result.indexOf("Exist::")==0)
{
openWindow('popTip.aspx','smsWindows','430','220');
}
}
else
{

}
}
}
</script>
</head>
<body onload="checkNormal();checkCalendar();">

在popTop里绑定数据
<script>
focus();
TimeStart=30;
function MyTimer()
{
if(TimeStart==0)
window.close();
if(document.getElementById("TimeShow"))
document.getElementById("TimeShow").innerHTML=TimeStart;
TimeStart--;
var timer=setTimeout("MyTimer()",1000);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息