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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:12:47+00:00 2026-05-25T15:12:47+00:00

I use ajax to load a page (example.html). I’ve got two buttons: one for

  • 0

I use ajax to load a page (example.html). I’ve got two buttons: one for ajax load function and another to act on loaded content. But it doesn’t react. I tried to use:

    $(document).ready(function(){
    $("#load")
        .click(function(){
        $("content").load("example.html");
    });
        $("#example_content").load(function(){
                  // some actions to loaded page 
}); 
  • 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-25T15:12:47+00:00Added an answer on May 25, 2026 at 3:12 pm

    the jQuery load function does not work like and event hook function, so the second .load call will expect to receive a url-like string to make a new request to the server to get more data (link http://api.jquery.com/load/).

    If you want to do something with the content that was loaded into the div, I’d suggest you use the ajax method, which could be used like this:

    $.ajax({
    
        //where is the data comming form? url
        url : "example.html",
    
        //what happens when the load was completed? the success function is called
        success : function(data){
             //add the content from the html to the div
             $("content").html(data.responseText);
    
             //do whatever else I want with the content that was just added to 'content'
            console.debug($('content')); // should show you all the html 
                                         // content written into that element 
    
            //my content specific funciton
            myFunction();
        }  
    });
    

    If you want to shorter way, using the $.get(url, success) function should help you, but this uses $.ajax inside, so you’re better off using directly $.ajax.

    Recap:

    1) .load is a function that uses .get to fetch content. http://api.jquery.com/load/

    2) .get has a success function, which writes the content received from the given url to the target element. http://api.jquery.com/jQuery.get/

    3) .get is a function .ajax, which is the core of the jQuery ajax functionality. http://api.jquery.com/jQuery.ajax/

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

Sidebar

Related Questions

I'm trying to use Ajax to fetch an HTML page and then pull out
Are ajax requests more resource-intensive than a normal page load? For example, I have
I use jQuery and AJAX to load content from links and forms into a
Can I have good example or code about how to use Ajax Datepicker in
When I load content with AJAX, is this content supposed to automatically use the
Here is my case: I use some external source to load html data to
I'm coding a site that makes heavy use of AJAX to load pages for
I've just attempted to make a simple script to use ajax to load a
I'm using the JsHelper to write JS links to use ajax to load in
I want to make an AJAX call to an HTML-returning page, extract part of

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.