DHTML Kitchen
05-27-2005, 02:06 AM
I know bc was working on something like this a while back. I just need simple
isImageOK function. returns true if status is 200, 302, 304, et c, but NOT 500, 404.
Basically, isImageOK.
var x = new Image();
x.src = "http://www.google.com/intl/en/images/logo.gif"
x.onerror = function(e) { document.title = e };
Mozilla fires onerror when the domain is not trusted. For example: when you're at smarty.php.net and and a script called a new Image from google.com, onerror would fire for mozilla and onload would not fire. Damn, I have no idea why.
Is there an easy way to tell if an image has loaded?
isImageOK function. returns true if status is 200, 302, 304, et c, but NOT 500, 404.
Basically, isImageOK.
var x = new Image();
x.src = "http://www.google.com/intl/en/images/logo.gif"
x.onerror = function(e) { document.title = e };
Mozilla fires onerror when the domain is not trusted. For example: when you're at smarty.php.net and and a script called a new Image from google.com, onerror would fire for mozilla and onload would not fire. Damn, I have no idea why.
Is there an easy way to tell if an image has loaded?