How to pass parameter while call a function using setInterval. viz. setInterval('funca(10,3)',500); is incorrect.
+6
A:
You need to create an anonymous function so the actual function isn't executed right away.
setInterval( function() { funca(10,3); }, 500 );
tvanfosson
2009-01-19 14:53:48
yep. silly me. I could have thought of that ! Thanks buddy
Rakesh
2009-01-19 14:56:11
Not sure. My source was: https://developer.mozilla.org/en/DOM/window.setInterval
Kev
2009-01-19 18:18:04
+3
A:
You can use an anonymous function;
setInterval(function() { funca(10,3); },500);
Simon
2009-01-19 14:55:23
A:
This is not exactly the same parameters as I read here: http://www.w3schools.com/jsref/met_win_setinterval.asp
I'm a bit confused ...
Jon Kleiser
2010-10-09 07:25:24