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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:25:56+00:00 2026-05-28T20:25:56+00:00

I have on my page ( page1.php ) a div called result that updates

  • 0

I have on my page (page1.php) a div called result that updates when you click a link with the loadlink id. It sends a url along to page2.php The script is:

$(function() {
  $(".loadlink").click(function(event) {
  event.preventDefault();
  $("#result").load($(this).data('url'));
  });
});

I want it so it also updates another div called crimes after this runs, with data from a url page3.php. How can i change the code to do this?

  • 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-28T20:25:57+00:00Added an answer on May 28, 2026 at 8:25 pm

    You can use the callback function of the .load() function to run another AJAX request once this one completes:

    $(function() {
        $(".loadlink").click(function(event) {
            event.preventDefault();
            $("#result").load($(this).data('url'), function () {
                $('#crimes').load('page3.php');
            });
        });
    });
    

    Note: if the second AJAX request does not rely on the first then you can run them simultaneously (just call them one after another and they will update the DOM whenever then return successfully). You will not know which one will come back first however, that’s the usefulness of the callback function, you will know that one has completed before sending the next request.

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

Sidebar

Related Questions

The Idea I have a main PHP page that loads content in DIV's from
I have a page that is accessed via a URL like this: http://power-coder.net/Test/something.php?id=3#Page1 I
I have a page index.php where i have a link called add_users.php. In add_users.php,
I have thumbnails on a page, as such: <div id=credits> <a href=largeimage1.jpg alt=credits1.php><img src=thumb1></a>
I'd like to have a page in php that normally displays information based on
I have a php page that displays rows from a mysql db as a
I have a PHP page that returns a piece of HTML to set the
So i have a page called region.php, which in the header, loads JQuery, the
I have a script that calls a php page via jquery/ajax. The results would
I have a php page that uses php sessions as well as jquery to

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.