That sounds almost too easy... I don't think it's possible.

I will have to keep track of the timers, and stop them manually. Also
I am going to take care that I am reusing names for functions and
variables, so they are redefined when the new script is loaded. This
will hopefully prevent memory leaks.


On 18 Okt., 17:20, "Eric Lin" <[EMAIL PROTECTED]> wrote:
> I think if you just assign each script element with a class or ID, you can
> later remove the element based on that ID.  All the variables and functions
> defined will also be removed.  I've done this before I think.
>
> On 10/18/07, happysad <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I am using the update function in Prototype to periodically load new
> > html and javascript into various elements on my page.
>
> > The loaded script can include timers - I am using PeriodicalExecuter.
>
> > Update works fine when it's just replacing html - but I would like it
> > to replace the previously loaded script as well instead of just adding
> > the new script!
> > I realize that this is a lot to ask for...
>
> > So my question is: How can I make sure that any old script (global
> > functions, variables and any running timers) gets cleared along with
> > the html when I am loading the new content? Is there a neat way of
> > doing this?
>
> > Lars- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to