Hi, On Apr 13, 5:24 am, Gregory Nicholas <faction.greg...@gmail.com> wrote: > If i setup an html link element to be observed, and then i > subsequently remove the html element without calling stopObserving(), > does that remove the observer? or does it create a leak of some sort?
It leaves the handler in memory, you do need to call stopObserving first. The same thing happens if you remove an ancestor of an element that has handlers still attached to it (e.g., div > form > input where you have a handler on the input, and you remove the div). Once or twice people have suggested that Prototype do it automatically, but there are a couple of reasons why that's not a great idea in practice, so those proposals haven't had "legs." HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Apr 13, 5:24 am, Gregory Nicholas <faction.greg...@gmail.com> wrote: > If i setup an html link element to be observed, and then i > subsequently remove the html element without calling stopObserving(), > does that remove the observer? or does it create a leak of some sort? > > Ex: > > $('logo').observe('click', function (e) { > e.stop();}); > > // remove the html element w/o stopObserving > $('logo').remove (); -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.