On a web page you can dynamically load an image in javascript and then display the size of the image. No problem. Then if you overwrite the image with one of a different size (but the same name) the new image will display but the old size is cached. The really bizarre thing is that if you close your browser and clear your cache and then go back to the page it STILL gets the size wrong.
Does anyone have a solution to this where the correct image size can be retrieved after the image has changed? Why does IE cache this?
Sample page:
<
htmlxmlns="http://www.w3.org/1999/xhtml"><
head><title>Test</title></
head><
bodyonload="LoadGif();"><div><inputtype="button"id="btnTest"value="Get Size"onclick="return GetSize();"/></div><scripttype="text/javascript">var obj = null;function LoadGif(){
obj = document.createElement(
"img");obj.src =
"test1.gif";document.body.appendChild(obj);
}
function GetSize(){
alert(
"x: " + obj.width + " y: " + obj.height);returnfalse;}
</script></
body></
html>