On Sep 9, 11:10 pm, Aaron Boodman <[email protected]> wrote:
> On Wed, Sep 9, 2009 at 9:00 PM, Trevor Bramble<[email protected]>
> wrote:
> > function refreshTimeline(){
> > setTimeout("$('#primary_nav>li.active>a').click();",60000);
> > refreshTimeline();
> > }
> > refreshTimeline();
>
> This is going to infinitely recurse. You need to delay the call to
> refreshTimeline as well. Unfortunately, doing the obvious thing --
> moving refreshTimeline into the string passed to setTimeout() isn't
> going to work because of isolated worlds [1].
>
> So you're going to need the other form of setTimeout that takes a
> function [2]. Inside the function, you can put the code you have now,
> plus a call to call refreshTimeline() again.
>
> [1]http://code.google.com/chrome/extensions/content_scripts.html#extecut...
> [2]https://developer.mozilla.org/en/DOM/window.setTimeout
Thanks, Aaron. The solution turned out to be even simpler than that:
setInterval("$('#primary_nav>li.active>a').click();",30000);
I did actually attempt a method that would not recurse, and when it
did not work attempted what you see above based on an example
elsewhere (I'm fairly green w/ JavaScript). Which was obviously not
much better.
This new setInterval method is the perfect thing though. I don't know
where it came from but it only has to work in Chromium, and it does.
So I'm happy. =^)
Cheers,
Trevor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---