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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:00:38+00:00 2026-05-18T03:00:38+00:00

I’m currently trying to get into jQuery. And I’m having a hard time (-;

  • 0

I’m currently trying to get into jQuery. And I’m having a hard time (-;

Right now I’m trying to load a page via .load()

scan_music  : function ()
{
 var target = $('#crawl_results');

 target.load('/admin/scanner/crawl_product_ids/de/music #product_ids', function()
 {
  admin.hide_loading();
 });
 return false;
}

That’s working pretty fine and everything’s getting displayed correctly. The page I’m loading has lots of checkboxes in it and I want to be able to toggle them all with one special checkbox (#check_all checks .to_be_checked).

Well, that function works fine. But it doesn’t work for ajax-loaded content.

check_all_boxes : function ()
{
 var check_all  = $('#check_all'),
     to_be_checked = $('.to_be_checked');

 check_all.live('click', function ()
 {
  to_be_checked.attr('checked', check_all.is(':checked'));
 });
}

I know that I have to use .live() to select the loaded content (working fine with check_all.live()). The problem is that the classes .to_be_checked aren’t affected and I have no clue how to use the live() function to select them in that case.

I hope you guys can help me out (:

Best regards!

  • 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-05-18T03:00:38+00:00Added an answer on May 18, 2026 at 3:00 am

    You need to run the DOM query again inside the live handler:

    check_all.live('click', function ()
    { 
       $('.to_be_checked').attr('checked', check_all.is(':checked'));
    });
    

    This is because at the time to_be_checked is assigned, it contains the result of the DOM query at the time of assignment, which is not what is the desired behavior.

    If you run the query again inside the handler, you will get the desired results.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

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.