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

  • Home
  • SEARCH
  • 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 6863003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:43:47+00:00 2026-05-27T02:43:47+00:00

I am trying to load some elements from another page under my site, and

  • 0

I am trying to load some elements from another page under my site, and I did.
But I also tried to apply some jquery action to the elements being loaded.
But, the scripts that I wrote for them are being skipped because they run before the elements are loaded.
Any idea how to detect if the element loading is complete?
(Maybe it is a stupid question, but I really cant find an answer).

This is how I load my elements:

$('#homeCat2').load('category.php?id_category=2 #product_list');

I tried something like this, but it was no use:

$('#homeCat2').load('category.php?id_category=2 #product_list',whenCompleteLoad());

function whenCompleteLoad(){
    var itemNum = $('.ajax_block_product').length;
    alert(itemNum);
};

I also tried to put the code for those elements in to the $(document).ready();
but, no luck….

Any suggestions?

  • 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-27T02:43:48+00:00Added an answer on May 27, 2026 at 2:43 am

    You are passing the output of whenCompleteLoad() to the callback slot of your .load() function. This happens because when you add the parentheses, you call the function.

    Removing the parentheses references the actual function, which is what you want:

    $('#homeCat2').load('category.php?id_category=2 #product_list',whenCompleteLoad);
    

    Or you can use an anonymous function (I prefer this method):

    $('#homeCat2').load('category.php?id_category=2 #product_list', function() {
      var itemNum = $('.ajax_block_product').length;
      alert(itemNum);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to load some returned html from an .aspx page but a
i'm trying to load some elements from a xml file. but it XDocument.Load seems
I'm trying to load page and then remove some elements in it. While doing
I am trying to load some info from the database asynchronously. I have a
I'm trying to load some images using Bitmap.getBitmapResource() , but it takes about 2
In the NodeMouseClick event I'm trying to load some objects from the Node.Tag. Before
I am trying to load data from XML string into a structure of some
I'm trying to watch for an element to load on the page from an
I'm trying to load some stuff using AJAX when a user clicks a link,
In the code below I'm trying to load some images and put them in

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.