views:

41

answers:

1

Hi all!

jQuery.ready() allows us to wait for the construction of the webpage. Recently it has been added support to wait until CSS files are loaded.

I would like to know if that feature can be used for downloaded content, because I fetch content via $.ajax() that holds CSS references and I would like to retrieve the content of the CSS before working with the retrieved content.

  1. Fetch with $.ajax() the html.
  2. --> Wait until all CSS is downloaded.
  3. Show to fetched content (already css'ed).

Thank you very much for your help.

A: 

Why not AJAX the CSS file, being sure to turn off the weird jQuery cachebuster, and then AJAX the HTML.

Steven Xu
Let's suppose that I download the content of the CSS file with Ajax before the HTML. How could I cache it in the browser? Thanks Steven.
David