im having some code similar to this:
var options = {
timerInterval: 800,
timer: null
};
var functions = {
someFunction: function() {
}
};
options.timer = setTimeout('functions.someFunction()', options.timerInterval);
This won’t fire though, because it can’t find the functions object.
What to do? 😀
try this:
it’s not recommended to write your function argument as a string in a
setTimeoutb/c it has to do some conversions that adds overhead to your script and can be avoided by using an anonymous function to call your function.