I have a small application that tries to launch a slide show for a set of pictures (jpg). It is implemented by a timed ajax routine to get the next picture filename and updating the image src field to show the next picture.
The problem is that the actual down load varies significantly in time, based mostly on a clients access speed and the resolution size of the picture. Since all this happens asynchronously, the delay time routine gets invoked and is exhausted before the download is completed in many cases.
Is there any way to start the new src coming and then detecting/waiting when it is complete?

A common solution in javascript is image pre-loading http://www.pageresource.com/jscript/jpreload.htm
You may not have to code it yourself in Ajax; I don't know.

If that approach by itself doesn't solve the problem, it is possible to test the image property 'complete' and/or wait for it to become 'true'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.