Loading ...
Sorry, an error occurred while loading the content.
 

What is the performance impact of orphaned listeners?

Expand Messages
  • cosmicrealms
    So I have a very big webpage with many many many addListeners added at several times during use of the webpage. Several elements are added to the page with
    Message 1 of 1 , Jun 27, 2006
      So I have a very big webpage with many many many addListeners added at
      several times during use of the webpage.

      Several elements are added to the page with .appendChild(), then they
      usually get some sort of listener added with
      YAHOO.util.Event.addListener()

      I know in my code when the appended elements are about to be removed
      with removeChild().

      As a matter of practice should I call removeListener() on the elements
      that currently have an event listener right before I remove them from
      the page?

      Are there any performance impacts or other problems with leaving a
      listener around for an element that no longer exists?
    Your message has been successfully submitted and would be delivered to recipients shortly.