HTML DOM Image complete property
Definition and Usage
complete property returns whether the browser has finished loading the image.
If the load is complete, it returns true, otherwise fasle.
grammar
imageObject.complete
Browser Support
All major browsers support complete property
Examples
Examples
The following example detects whether the graphic has finished loading:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function alertComplete () {
alert ( "image is loaded:" + document.getElementById ( "compman") complete.);
}
</ Script>
</ Head>
<Body onload = "alertComplete ()">
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function alertComplete () {
alert ( "image is loaded:" + document.getElementById ( "compman") complete.);
}
</ Script>
</ Head>
<Body onload = "alertComplete ()">
<Img id = "compman" src = "compman.gif" alt = "Computerman" width = "107" height = "98">
</ Body>
</ Html>
try it"
Image Object