Image not loading from cache after it's loaded in an iframe
Posted
by
Amir
on Stack Overflow
See other posts from Stack Overflow
or by Amir
Published on 2011-02-12T23:11:14Z
Indexed on
2011/02/12
23:25 UTC
Read the original article
Hit count: 230
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
© Stack Overflow or respective owner