I am looking for a way to implement this for as many browsers as possible:
var image = new Image();
image.addEventListener("load", function() {
alert("loaded");
}, false);
image.src = "image_url.jpg";
This didn't work in IE so I googled and found out that IE's lower than 9 do not support .addEventListener()
. I know there is a jQuery equivalent called .bind()
but that doesn't work on an Image()
. What do I have to change for this to work in IE too?