À©µµ¿ìÀÇ ¼öÇ๮À̳ª ±â´ÉÇÔ¼ö¸¦ ÀÏÁ¤ÇÑ ½Ã°£ °£°ÝÀ¸·Î ¹Ýº¹Çؼ ¼öÇàµÈ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, ÇöÀçÀÇ À©µµ¿ì °³Ã¼ÀÌ´Ù.
JScript | µðÆúÆ®À̸ç, JScript ¾ð¾îÀÌ´Ù. |
VBScript | VBScript ¾ð¾îÀÌ´Ù. |
JavaScript | JavaScript ¾ð¾îÀÌ´Ù. |
¹Ýȯ°ª oTimerId´Â clearInterval ¸Þ¼µå¿¡ ÀÇÇÏ¿© ŸÀ̸Ӱ¡ Ãë¼ÒµÉ ¶§ÀÇ ½Ã°£ ÀνÄÀÚ¸¦ ¹ÝȯÇÑ´Ù.
setInterval ¸Þ¼µå´Â ÁöÁ¤ÇÑ ÀÏÁ¤ÇÑ ¹Ð¸®ÃÊ°ª imillisec ½Ã°£ °£°ÝÀ¸·Î Ç¥Çö½Ä javascriptCode³ª ±â´ÉÇÔ¼ö functionNameÀ» È£ÃâÇÏ´Â ¼ö´ÜÀ» Á¦°øÇÑ´Ù.
ÀÌ ÀÏÁ¤ÇÑ ½Ã°£ °£°ÝÀ¸·Î ¹Ýº¹µÇ´Â ÀÛ¾÷Àº clearInterval ¸Þ¼µå¸¦ ¸¸³¯ ¶§±îÁö ȤÀº À©µµ¿ì°¡ ´Ý±æ ¶§±îÁö °è¼ÓµÈ´Ù.
Ç¥Çö½ÄÀ̳ª ±â´ÉÇÔ¼ö°¡ ³»ÀåµÈ ±â´É¿¡ ÀÇÇÏ¿© eval() ±â´ÉÇÔ¼ö¿¡ ÁØÇØ Æò°¡µÇ¹Ç·Î, Á÷Á¢ ¼öÇàµÇÁö ¾Êµµ·Ï ¹Ýµå½Ã µû¿ÈÇ¥·Î ¹¿©¾ß ÇÑ´Ù.
Á¦°øµÈ Àμö°¡ À¯È¿ÇÏÁö ¾ÊÀ¸¸é ¾Æ¹« ¼öÇ൵ µÇÁö ¾Ê¾Æ ¾Æ¹« º¯Èµµ ¾ø´Ù.
IE5 ÀÌÀü ¹öÀü¿¡¼´Â clearIntervalÀÇ Ã¹ ÆĶó¸ÞÅÍ°¡ ¹®ÀÚ¿À̾î¾ß¸¸ Çß¾ú´Ù. ¹®ÀÚ¿ÀÇ ÆÇÁ¤Àº ÁöÁ¤µÈ ÀÎÅ͹ßÀÌ Áö³¯ ‹š±îÁö À¯º¸µÇ¾ú´Ù.
IE5¿¡¼´Â clearIntervalÀÇ Ã¹ ÆĶó¸ÞÅÍ°¡ ¹®ÀÚ¿À̳ª ±â´ÉÇÔ¼ö Áö½ÃÀÚ°¡ µÉ ¼ö ÀÖ´Ù.
±â´ÉÇÔ¼ö¸¦ Àü´ÞÇϱâ À§ÇÏ¿© ±â´É ¸íĪÀ» ÆĶó¸ÞÅÍ·Î Á¦°øÇÑ´Ù.
window.setInterval("someFunction()", 5000);
±â´ÉÇÔ¼ö Æ÷ÀÎÅ͸¦ Àü´ÞÇÒ ¶§´Â °ýÈ£¸¦ »ç¿ëÇÏÁö ¸»¶ó.
window.setInterval(someFunction, 5000);
behavior¿Í ÇÔ²² setInterval ¸Þ¼µå¸¦ »ç¿ëÇÒ ¶§, vCodeÀÇ °ªÀº HTC(HTML Component) ÆÄÀÏ ¼ÓÀÇ ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ´Â ±â´ÉÇÔ¼ö Áö½ÃÀÚÀ̰ųª, ÀÏÂ÷ ¹®¼¿¡ ÀÖ´Â ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ´Â ¹®ÀÚ¿À̾î¾ß ÇÑ´Ù.
°³Ã¼ | script | IE |
---|
<FORM name="myForm"><INPUT name="myTimer" type="Text" size="30"></FORM> <SCRIPT> self.setInterval('timer()',100); function timer(){ document.myForm.myTimer.value=new Date(); } </SCRIPT>
<SCRIPT> var ms; function getMilSec(){ ms=new Date().getMilliseconds(); } function showMilSec(){ getMilSec(); showB.innerHTML=ms; } </SCRIPT> <DIV id=showB style=text-align:right;width:100></DIV> <BUTTON onclick="msTimer=window.setInterval('showMilSec()',10);">¹Ð¸®ÃÊ ½ÃÀÛ</BUTTON> <BUTTON onclick="if (msTimer) window.clearInterval(msTimer);">¹Ð¸®ÃÊ Á¾·á</BUTTON>
±â´ÉÇÔ¼ö Æ÷ÀÎÅ͸¦ »ç¿ëÇÑ ¿¹Á¦
<DIV id=showA style="color:blue"> </DIV> <SCRIPT> iSw=1; function callA(){ showA.innerHTML=new Date().toLocaleString(); iSw=0; } function callB(){ showA.innerHTML=new Date().toUTCString(); iSw=1; } function clockA(){ if (iSw) callA(); else callB(); } </SCRIPT> <INPUT type=button value="ŸÀÌ¸Ó ½ÃÀÛ" onClick="timerA=window.setInterval('clockA()',1000);"> <INPUT type=button value="ŸÀÌ¸Ó ÁßÁö" onClick="if (timerA) window.clearInterval(timerA)">