OA里面定时提醒功能实现 .

时间:2022-08-31 20:52:25

通过定时器弹出提示窗口,很多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);