METHOD:
Window::setInterval
window.setInterval(expression/function,
milliseconds)
This method is used to call a function
or evaluate an expression at specified intervals, in milliseconds. This
will continue until the clearInterval method is called or the window
is closed. If an expression is to be evaluated, it must be quoted to prevent
it being evaluated immediately
The following example uses the setInterval method to call the clock()
function which updates the time in a text box.
Code:
<form name="myForm" action="" method="POST">
<input name="myClock" type="Text">
<script language=javascript>
self.setInterval('clock()', 50)
function clock() {
time=new Date()
document.myForm.myClock.value=time
}
</script>
</form> |