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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:49:57+00:00 2026-05-12T08:49:57+00:00

i have two links <a href=page1.html>page 1</a> <a href=page2.html>page 2</a> <div id=content>&nbsp;</div> 1. I

  • 0

i have two links

<a href="page1.html">page 1</a>
<a href="page2.html">page 2</a>

<div id="content">&nbsp;</div>

1. I use JQuery to load them into a Div when the links are clicked.

$('#content').load('page1.html');

2. When the second link is clicked I empty the div

$('#content').html('');

3. and load the second file in;

$('#content').load('page2.html');

The problem, page1.html has alot of images in it, even after the second link is clicked and the #content div is emptied, the browser keeps downloading the images from page1.html and this slows down the request to page2.html significantly.

How can i stop the content from the first load() from making requests to the browser and speed up the page response?

Thank you infinity!

  • 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-12T08:49:57+00:00Added an answer on May 12, 2026 at 8:49 am

    I don’t think you’ll be able to use load. I think you’ll need to use the ajax function.

    From the docs:

    $.ajax() returns the XMLHttpRequest that it creates. In most cases you won’t need that object to manipulate directly, but it is available if you need to abort the request manually.

    It’s more code, but shouldn’t be that bad. You will probably need to tweak this code (it’s untested), but I think the concept will work.

    var xhr;
    
    $("a").click(function() { 
      if(xhr !== undefined) { xhr.abort(); } 
      xhr = $.ajax({
        url: this.href,
        success: function(data) {
           $("#content").html(data);
        }
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say i have two pages links.html & contents.php ... first page contains only
I have two page page1.php and page2.php, on page1.php i click on a href
I have two jquery scripts on one page that both target on-site links via
I have an element like so: <a class='link' href='/page1'>Page 1</a> It has a click
I'm using Jquery mobile framework. I have 2 html files which has two buttons
I have an navigation where i load a page into a div called target.
I have two links with classes (login-form and register-form) relevant to their target forms
I have two divs and two separate links that triggers slideDown and slideUp for
I have a piece of code: links |> Seq.map (fun x -> x.GetAttributeValue (href,
This is a strange problem. I have two html pop-up windows, just hidden divs

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.