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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:43:57+00:00 2026-05-17T18:43:57+00:00

i am loading some fragments with jquery with following code var box = $(this).closest(.product-contain).children(.title:first);

  • 0

i am loading some fragments with jquery with following code

var box = $(this).closest(".product-contain").children(".title:first");
box.load(url + " .maintitle", data);
var box = $(this).closest(".product-contain").children(".detail:first");
box.load(url + " .alldetail", data);

(i don’t want to load whole .product-contain at once, because part of it is being edited by user at the same moment)

but it does 2 requests to server for same content.

can i somehow do it with one request?

thanks!

  • 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-17T18:43:57+00:00Added an answer on May 17, 2026 at 6:43 pm

    You can do one $.get() and load the content where it goes yourself, like this:

     var pc = $(this).closest(".product-contain");
     $.get(url, data, function(html) {
       var resp = $(html);
       pc.children(".title:first").html(resp.find(".maintitle"));
       pc.children(".detail:first").html(resp.find(".alldetail"));
     });
    

    This may look a little weird, but .html() with a jQuery object is a shortcut for .empty().append().

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

Sidebar

Related Questions

Using jQuery 1.7.1, I am loading some HTML fragments via AJAX that are injected
I'm loading some HTML via Ajax with this format: <div id=div1> ... some content
In my application, I'm loading some data from a file. This can fail and
Let's say I do this: $(#content).load(...); Within what I'm loading some javascript is included:
I'm loading in some HTML content like this: $('#scores').load('scores.php #scores'); Note that It is
I have this code, loading XML documents on mouseenter, which works in Firefox: $(document).ready(function()
I'm loading some python code from a database (it's doing dynamic mapping of values
I'm loading some content into a jquery-ui dialog via .ajax. That's all working fine
working in mvc In this Json result i am loading some dropdownlist it is
This fragment of code was taken from OpenNI sample called NiUserTracker //... some codes...

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.