Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9178695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:36:49+00:00 2026-06-17T17:36:49+00:00

If an event listener is attached to every cell in a particular column of

  • 0

If an event listener is attached to every cell in a particular column of a table, and then every row is removed from the table, to avoid memory leaks is it necessary for the developer to remove the event-listeners before the rows are deleted, or do the browsers clean things up?

Edit: the article that Michael suggested says event delegation performs better than binding the listener directly to every cell in the table, but I am not sure if it is better from a garbage-collection perspective or just performs better. Please comment. From the article:

        $('table').on('click', 'td', function () {

            $(this).toggleClass('active');

        });

is said to be superior to:

        $('table td').on('click', function () {

            $(this).toggleClass('active');

        });

Edit2: and the jQuery documentation of .on() and event delegation also focuses on performance, but the question of what happens from a garbage-collection perspective when rows are repeatedly deleted en masse from a large table, and the cell-click is being listened to by the delegated mechanism, remains.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:36:50+00:00Added an answer on June 17, 2026 at 5:36 pm

    I am not sure, but i guess this brilliant article will clean things up (search for “Garbage Collection”): http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a button with an onclick event listener attached (in MooTools). It works
I am building a Firefox add-on. I have attached an event listener to links
If I do the following the variable is passed to the attached event listener
If I have an onClick listener attached to an li element, then if that
I have added an event listener for a particular event, for e.g. CollectionEvent.COLLECTION_CHANGE. Inside
I'm attempting to disable links clicked. I have an onmousedown event listener attached as
textChanged and valueCommit both event listener are attached with a spark textarea as follows:
I set up event listener, for example: setOnClickListener like this Button stopBtn = (Button)findViewById(R.id.stop);
I have this event listener: input_1.addEventListener('input',function(){ updateFromInput(1); },false); It controls the location of a
I have the following event listener in SecurityConfig security { active = true useSecurityEventListener

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.