[jQuery] Re: Passing jQuery object to a function

2009-10-08 Thread Michael Geary
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

[jQuery] Re: Passing jQuery object to a function

2009-10-08 Thread James
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)