In jQuery, I know that I can use the $ .ajax function to load an html page from a given URL. However, I am interested in downloading htmla and all the resources on this page before displaying it. How should I do it?
Example: Say I have the following html in a file called about.html
<h1>About BigImage</h1>
<img src="/images/reallybigimage.jpg" />
Please note that I have an image on this page. Using the jQuery ajax function, I would get "success" as soon as the HTML finished loading, but not the image.
Here, for example, is a kicker: I don’t know how many / which images I will have on the page, and these are not only the images I want to upload - all the resources of the page are css and that's it. Any way to do this?
Thank!
source
share