Onload event is fired only after clearing cache(Ctrl+R) when I load an image or video. How to fire the onload event for cached objects?
var img=document.getElementById("myimage");
img.onload=function(){console.log("loaded");};
img.src="http://myimage.jpg";
Thank you!