var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/" + filename;
var img = document.getElementById(element_id);
if (img != null) {
- img.src = "";
+ img.src = "data:";
img.parentNode.removeChild(img);
}
// cancel any pending preload
var preload = document.getElementById("preload");
if (preload != null) {
- preload.src = "";
+ preload.src = "data:";
preload.parentNode.removeChild(preload);
}
-
- if (document.all) { // IE-specific
- img.onload = "display_image(" + width + "," + height + ",\"" + evt + "\",\"" + filename + "\",\"preload\");";
+
+ // grmf -- IE doesn't fire onload if the image was loaded from cache, so check for
+ // completeness first; should at least be _somewhat_ better
+ if (img.complete) {
+ display_image(width, height, evt, filename, "preload");
} else {
- img.onload = function() { display_image(width, height, evt, filename, "preload"); }
- }
+ img.onload = function() { display_image(width, height, evt, filename, "preload"); };
+ }
}
function relayout()