Image Loaded

[Total: 0    Average: 0/5]

This shows several of the methods available to the author to determine when and even if the image loads completely.

Body Code:

<script type=text/javascript>
var _pic = new Image();
function isLoaded() {
  if (_pic.complete) alert(" has loaded");
  else alert(" has not loaded.");
function picError()   { alert("error");   }
function picLoaded()  { alert("loaded");  } // if already cached no event! its a gotcha!
function picAborted() { alert("aborted"); }
function clickMe() { _pic.src=""; isLoaded() }
document.write('<BR><a href="javascript:clickMe()">CLICK ME</a>');

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *