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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:23:18+00:00 2026-06-02T07:23:18+00:00

In jQuery, I know I can use the $.ajax function to load a page’s

  • 0

In jQuery, I know I can use the $.ajax function to load a page’s html from a given URL.
However, I’m interested in loading the htmla nd all resources on that page before displaying it. How would I go about doing that?

Example:
Say I have the following html in a file called about.html

<h1>About BigImage</h1>
<img src="/images/reallybigimage.jpg" />

Notice that I have an image in this page. Using jQuery’s ajax function, I would get a “success” as soon as the HTML finished loading, but not the image.

Here’s the kicker, though: I don’t know how many/which images I’ll have in the page, and it’s not just images I want to be loading — it’s all the page’s resources — css and all.
Any way to do this?

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-06-02T07:23:20+00:00Added an answer on June 2, 2026 at 7:23 am

    If relative paths are not a problem, in your success function, you can then attempt to find all of the links and load them like this:

    //....
    success:function(data){
        $("*",data).each(function(){
            if($(this).attr("src")){
                $.ajax({url:$(this).attr("src"),dataType:"text"});
            }
            if($(this).attr("href")){
                $.ajax({url:$(this).attr("href"),dataType:"text"});
            }
        });
    }
    //....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if I can use the following JQuery function on
i am trying to use the Jquery ajax function to call a php page
I would like to know how can I use jQuery to select multiple items
I know in jQuery 1.4.x there is a method delay(). We can use it
I know from here that I can pass an ignore option in the jQuery.validate
As I understand it, the JQuery load() function retrieves a document and can perform
I'm trying to use jQuery's .AJAX function to send a request to IPINFODB's API
I know that jQuery, for example, can do animation of sorts. I also know
I would like to know if I can include some Jquery inside another JQuery
I have code that uses jquery.slideup and jquery.slidedown How can i know that div

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.