Hi everyone, Let say, i have a page that output this a several image, how to check weather a certain image already successfully load to user browser? example image: <div><img src='http://www.nasa.gov/images/content/84857main_EC04-0325-23_lg.jpg' width='336' height='280'></div> i need to return a value is the picture finish load. Thanks.
You can test the .complete property, but it can be misleading. It's more reliable to use the onload handler, either to add a property to the image object or to call some other function: <img name='img1' onload="this.hasLoaded=true" .....> if( document.images.img1.hasLoaded ) ... Code (markup):