Loading HTML fragments concurrently with AJAX calls

7331

New Member
I have a website where I use jQuery AJAX calls to load HTML fragments as an initialization step. Only when all of my HTML fragments were loaded, I start to render my site. My question is what is the best way to do it? How can I know efficiently when all of my ajax requests were done (that is, all of my HTML fragment are ready), if they were running concurrently? Is there any kind of a way to have a callback function that will be launched when all of my concurrent ajax jobs are done?My current solution is to launch the next AJAX job whenever the previous AJAX job is completed... but this solution results in a serial execution, and a very messy code...Is there any other convenient way to do it?Thanks!
 
Back
Top