jQuery .load() wait till content is loaded

Posted by user1785870 on Stack Overflow See other posts from Stack Overflow or by user1785870
Published on 2012-12-03T23:08:11Z Indexed on 2012/12/04 11:08 UTC
Read the original article Hit count: 496

Filed under:
|
|
|

How to prevent jQuery $('body').load('something.php'); from changing any DOM till all the content from something.php (including images,js) is fully loaded

-Lets say some actual content is:

Hello world

And something.php content is:

image that loads for 10 seconds
20 js plugins

After firing .load() function nothing should happen, till images an js files are fully loaded, and THEN instantly change the content.

some preloader may appear, but its not subject of question.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX