Should this work?
<script type=text/javascript>
function load_i () {
img = new Image();
img.onload = load_e();
img.src = "whatever.jpg";
}
function load_e() { alert("loaded"); }
</script>
Right now the image gets loaded, but apparently the onload event isn’t being triggered.
Tried it in FF and Chrome.
change:
to:
With the following line:
You’re calling
load_eand assigning the result,undefined, toimg.onload.