And to explain why that makes a difference, when you use a string in
setTimeout it evaluates the code in the global context - as if it were
outside all your functions. So the timeout code can't see the tabLink
variable.
Using a callback function takes care of that, since a nested function can
acce
Try:
setTimeout(function() {
playGlobalNewsFn(tabLink);
return false;
}, timeLag);
On Oct 8, 8:47 am, vmrao wrote:
> I have the following code. I am getting an error in the setTimeout
> function, "tabLink" is undefined. Not sure what am I doing wrong.
>
> function playGlobalNewsFn(obj)
2 matches
Mail list logo