Scripting image.complete
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.1">
function loadIt(theImage,form) {
form.result.value = ""
document.images[0].src = theImage
}
function checkLoad(form) {
form.result.value = document.images[0].complete
}
</SCRIPT>
</HEAD>
<BODY>
<IMG SRC="cpu2.gif" WIDTH=120 HEIGHT=90 onLoad="">
<FORM>
<INPUT TYPE="button" VALUE="Load black" onClick="loadIt('http://www.java2s.com/style/logo.png',this.form)">
<INPUT TYPE="button" VALUE="Load red" onClick="loadIt('http://www.java2s.com/style/logoRed.png',this.form)"><P>
<input TYPE="text" NAME="result">
</FORM>
</BODY>
</HTML>
Related examples in the same category