setTimeout(myFunction(parameter),myTimeout);
but that doesn’t work. An apparent solution (until tried in Internet Explorer) is:
setTimeout(myFunction,myTimeout,parameter);
It wasn’t as easy as I expected to find out how to get around this, but it turns out that all is needed is a “closure”:
setTimeout(function(){myFunction(parameter)},myTimeout);
Reference:
No comments:
Post a Comment