www.webdeveloper.com
Results 1 to 2 of 2

Thread: Deleting objects

  1. #1
    Join Date
    Jun 2011
    Posts
    1

    Deleting objects

    I am creating JS objects that have some properties that contain DOM nodes, and some of these DOM nodes have event listeners attached to them.

    When I delete such objects, do I first need to remove the event listeners attached to some of the DOM nodes? And do I need to use removeChild on the DOM nodes that are properties of the object?

    Or does JavaScript take care of all that?

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    unless this is an open-all-day script that has to run in IE 6/7 i wouldn't worry about it.

    you should use event delegation upon a parent to remove any gotchas associated with pesky element/event closures on disposable elements.

    EDIT:

    i mis-read the question.
    you can just delete them from your mixed property object without harm.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles