I want to do:
$(\"img\").bind(\'load\', function() { // do stuff });
But the load event doesn\'t fire when the image is loaded from cache
A modification to GUS's example:
$(document).ready(function() { var tmpImg = new Image() ; tmpImg.onload = function() { // Run onload code. } ; tmpImg.src = $('#img').attr('src'); })
Set the source before and after the onload.