Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slow loading images, best way to display temporary image? JQuery perhaps?

Tags:

jquery

I am using Google Charts to display charting data in my application. Sometimes Google is slow and the charts will take a while to load. This scenario seems to be a common enough pattern -- so I'm wondering what's a good approach to show a temporary image, while the image is delivered from Google. I have access to jQuery -- and have seen a number of "preloading" plugins. Is this what I need?

Is the correct term for this scenario/pattern really called "image preloading"?

I'd love to hear what people use to solve this situation.

thanks

like image 559
rsturim Avatar asked Feb 03 '23 07:02

rsturim


2 Answers

You can show one of those fancy loading gifs found at http://ajaxload.info/ while the image is loading. After the image is loaded you hide the loading gif and show the image itself.

check http://jqueryfordesigners.com/image-loading/ for a tutorial.

like image 121
Flatlin3 Avatar answered Feb 06 '23 05:02

Flatlin3


Image preloading is usually when you download images in anticipation of their being requested but before the user actually makes a request to see them. I believe the current thinking is this usually adds overhead unless a very large percentage of your users can be expected to view the image.

like image 36
No Refunds No Returns Avatar answered Feb 06 '23 05:02

No Refunds No Returns