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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:57:11+00:00 2026-05-16T21:57:11+00:00

So I was working with jQuery’s .load() just now and it looks like we

  • 0

So I was working with jQuery’s .load() just now and it looks like we can’t configure $("#example").load('./uri.ext #ID') to chain as such:

$("#example").load('./uri.ext #ID1').load('./uri.ext #ID2').load('./uri.ext #ID3')

Which of course would be useful if we had a template file of DIVs or something to dynamically build a page and not store the HTML in a string variable or something along those lines… plus, we could keep several of these in one file.

Ideally I would like to nest things as such with that command:

<div id="example">
    <div id="ID1">
        <div id="ID2">
            <div id="ID3">
            </div>
        </div>
    </div>
</div>

The problems I’m getting are two-fold. First, the async : true property of the request causes the next request to fire and the placement doesn’t preform as intended. I had then attempted to run nested $(“#example”).load(‘./uri.ext #ID1’).ajaxCompletes(function () {/next .load() in sequence/})` which ended up in a recursive trap that didn’t end and kept sending requests for those files.

Any thoughts on how to accomplish what I’m after with a syntax/method like I had attempted? Also, if this isn’t a problem and just a misunderstanding on my part of jQuery’s chaining, an explanation I would be very thankful for any explanation into that.

  • 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-16T21:57:12+00:00Added an answer on May 16, 2026 at 9:57 pm

    You would need to nest them in the callback functions to achieve this:

    $('#example').load('./uri.ext #ID1', function() {
      $('#ID1').load('./uri.ext #ID2', function() {
        $('#ID2').load('./uri.ext #ID3', function() {
          // load successful
        });
      });
    });
    

    EDIT for ES6 standards:

     $('#example').load('./uri.ext #ID1', () => {
          $('#ID1').load('./uri.ext #ID2', () => {
            $('#ID2').load('./uri.ext #ID3', () => {
              // load successful
            });
          });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working jQuery, what I'd like to perform is something similar to the following: $('sometag').children().wrap('<div></div>');
On IE I can do this with the (terribly non-standard, but working) jQuery if
I have a working simple jquery drop-down menu . But problem is how can
Working with JQuery Validator and just have a quick question. I'm using addMethod to
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I'm working with jQuery for the first time and need some help. I have
I'm working with jQuery UI's droppables and am wondering what the best way to
I've been working with jQuery and *.asmx web services lately, and I'm trying to
I'm working with jQuery and looking to see if there is an easy way
I've been working with jQuery for a pair of weeks and I've noticed it

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.