View Full Version : can you check for broken links?

04-18-2005, 02:51 AM
I want to run some code if there is an image that isn't showing. how do i check for the condition if whatever.src=[not existing/null or whatever]?

04-18-2005, 05:55 AM
var img = new Image();
img.onerror = function(){alert("error in loading!")};
img.onloaded = function(){alert("loaded successfully!")};
img.src = "blah.gif";

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum