I\'m using the canvas feature of html5. I\'ve got some images to draw on the canvas and I need to check that they have all loaded before I can use them.
I have declared
Use the window.onload which fires when all images/frames and external resources are loaded:
window.onload
window.onload = function(){ // your code here........ };
So, you can safely put your image-related code in window.onload because by the time all images have already loaded.
More information here.