function OnLastestNumberOfEmailsReady(result, userContext, methodName) { var numberOfEmails_new= result; if (numberOfEmails_new > numberOfEmails_original) { ShowPopup(); $get("modalBody").innerHTML= numberOfEmails_new - numberOfEmails_original; // Update the count here numberOfEmails_original= numberOfEmails_new; } // Start checking again window.setTimeout(StartChecking, 10000); }
这个方法,用当前邮件数-原来邮件数,就得出新增了多少封邮件了,再将结果赋值给显示区域的modalbody,并且记得把当前邮件数量的,变量更新哦(numberOfEmails_original= numberOfEmails_new;)
然后再用setimeout来设置每隔10000毫秒检查一次了
function ShowPopup() { $get("UpdateProgress1").style.visibility= "visible"; $get("UpdateProgress1").style.display= "block"; } function HidePopup() { $get("UpdateProgress1").style.visibility= "hidden"; $get("UpdateProgress1").style.display= "none"; } </script>
(编辑:aniston)
|