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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:48:12+00:00 2026-06-16T17:48:12+00:00

Possible Duplicate: Initialize script I have a page (Page1.html) and in this page a

  • 0

Possible Duplicate:
Initialize script

I have a page (Page1.html) and in this page a div (#div1) that get its content from other divs in another page (Page2 #div1/2/3/4/5). The content is loaded in by jQuery load script. The content is loaded in based on choice in a select box, so the content is loaded in after Page1 has finish loaded.

Problem:
When I get some content from Page2 that’s depending on jQuery, these elements don’t work. They don’t execute.

My questions:
Is there any way to make the a whole inloaded #div from Page2 (all the content) to execute WHEN its loaded in? Right now the existing elements “initialize” when they are loaded in, for example: function initializeSlider(){ slider };.

Now I am trying to add in some more elements depending on jQuery, and wounder if initializing all the objects is the correct way of execute all these scripts, or is there any way that execute all the jQuery elements at once so no need to initializing all object one by one?

Executing or Initializing one script:
If there is no way to execute/initialize all scripts at once when a div is loaded in. I am trying to execute or initialize this script without success, have tried both the “$(document).ready(function() {” and initialize it similar to the slider but the element is not executing.

$(document).ready(function() {
    $(".lil").click(function () {
      $(this).toggleClass("highlight");
    });
});
  • 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-16T17:48:13+00:00Added an answer on June 16, 2026 at 5:48 pm

    Use:

    $(document).ready(function() {
        $("#div1").on('click', '.lil', function () {
          $(this).toggleClass("highlight");
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to initialize a const field in constructor? I have this class:
Possible Duplicate: Ruby.Metaprogramming. class_eval I have this little project, the goal is to create
Possible Duplicate: How to break outer cycle in Ruby? say I have this code:
Possible Duplicate: Should I initialize variable within constructor or outside constructor I have here
Possible Duplicate: jquery UI dialog: how to initialize without a title bar? $(<div id='divLoading1'
Possible Duplicate: How to initialize a two-dimensional array in Python? I have always written
Possible Duplicate: Recommended way to initialize srand? I have the following problem when using
Possible Duplicate: Does this type of memory get allocated on the heap or the
Possible Duplicate: Is it a bug that Microsoft VS C++ compiler can Initialize a
Possible Duplicate: Initializing private static members Why I can't initialize non-const static member or

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.