Image not loading from cache after it's loaded in an iframe
- by Amir
I'm loading an image in an iframe and then (once the iframe is loaded) loading the image on the page. But most browsers seem to be loading the image twice. Why isn't the img tag being loading from the cache?
Something like this:
var loader = $('<iframe />').appendTo('body')[0];
loader.onload = function() {
$('body').append('<img src="' + imgsrc + '" />');
};
loader.src = imgsrc;
http://jsfiddle.net/amirshim/na3UA/
I'm using fiddler2 to see the network traffic.
In case you want to know why I want to do this, check out this question