Tuesday, May 20, 2008
Scripting time-out Javascript


setTimeout question
How do you pass variables into a function that is called in setTimeout. anyone?
example javascript code
<script>
function test(val){
alert('ok'+val);
}
setTimeout(test(5),1000);
</script>
The above code doesn't seem to work. what am I doing wrong?
example javascript code
<script>
function test(val){
alert('ok'+val);
}
setTimeout(test(5),1000);
</script>
The above code doesn't seem to work. what am I doing wrong?
I prefer to not use setTimeout. Instead try looking up Extjs.com. Their library has something called DelayedTask which provides what you have asked for. Thanks.. |
19 May 2008 19:09:33 -0700 |
Get Clipmarks - The easiest way to email text, images and videos you find on the web.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment