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 9118683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:12:47+00:00 2026-06-17T05:12:47+00:00

There is a table on a page which I update over ajax. There are

  • 0

There is a table on a page which I update over ajax. There are some scripts those use content of a table. For instance, one of them uses “Check all / Uncheck all” checkBox on a table to check/uncheck the other checkboxes on that table.

When I do an ajax request, it returns almost the same content of a table. At least, it’s definitely correct and should not destroy the functionality of the scripts. However, after that none of the scripts no longer work. Why?

For example, here is the part of a javascript code at *.js file:

$(document).ready(function() {
  $("#check-all").change(function(){
      $(".my_table input[type=checkbox]").prop('checked', this.checked);
    });
});

Before executing ajax, request everything is working well. Note that ajax doesn’t return any javascript code, all javascript code is located in an external js file.

  • 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-17T05:12:49+00:00Added an answer on June 17, 2026 at 5:12 am

    Because you are using an event handler that is added on document.ready and anything added after it will not have the events.

    After jQuery 1.7, you can use on.

    $(document).on("change", "#check-all", function(){ ... });
    

    other option is to keep what you have, just recall the code when you update the page’s content.

    function addChangeEvent() {
      $("#check-all").change(function(){
          $(".my_table input[type=checkbox]").prop('checked', this.checked);
        });
    }
    
    $(document).ready(function() {
        addChangeEvent();
    });
    

    and with your Ajax call

    $("#foo").load("xxx.html", function(){ addChangeEvent()l });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mvc project and on one page there is a table of
In my html page, I have one table, for every row there are two
I have a form on my PHP page which performs some ajax validation (that's
in a Table there is a single attribute(column).it contains numbers.Some are repeated(2 or 3
I have one webpage (lets call it A.html). A.html has some javascript which switches
We have a ColdFusion page where admins can insert/update some real estate records after
I have a page which opens another page using window.open and does some work
I have 2 scripts/pages, both using session data. Page 1 is a table with
I have simple insert/update page where I do check if there is id, if
I am going to use ajax for my web form app without any update

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.