How to check if file download is complete?


I am trying to build a script, where the file references get added to an array when downloaded.
I have a slideshow so I want it the image references to be dynamically added to the javascript array. Any ideas how to do this? Is there an event which returns true when download complete?

You could attach an onload handler to each Image object/placeholder depending on how your code is structured:

imgObj.onload = function(){ myArray.push( this.src ); }