|
|
Q946 Why is the first parameter of the setTimeout() method enclosed in quotes?
irt.org | Knowledge Base | JavaScript | Timeout | Q946 [ previous next ] Q946 Why is the first parameter of the setTimeout() method enclosed in quotes?Its an expression to be evaluated at the time of the execution. If you did:
Then the test() function will be evaulated straight away and the result returned as the expression to be evaluated after a five second delay, which is probably not want you want. But this could be useful, for example:
|
-- div -->
|