Skip to content Skip to sidebar Skip to footer

Ajax: Simultaneous Loading Of Multiple Images

I have a grid of pictures (3x3, side by side, laid out in a ). I need to update this grid every so often. Since every picture independent from the rest (they get grabbed from diffe

Solution 1:

Since the ajax calls are blocking as said by chrisdpratt, if you really need to display the images at the same time I would advise some kind of preloading of the 3x3 grid of images and when required by the code you can display them.

With this in mind you can run the code you already have on $(document).ready() but make the images hidden (ie display:none). When later required you would just change the display attribute on the images you need to display.

Solution 2:

If the issue you were seeing was indeed caused by the single-threaded implementation of the Django development server, you might try django-devserver (https://github.com/dcramer/django-devserver). Amongst other improvements, it boasts:

"An improved runserver allowing you to process requests simultaneously."

The other improvements make it worth it, too!

Post a Comment for "Ajax: Simultaneous Loading Of Multiple Images"