hello,
my code is something like this:
function func1() {
document.getElementById("img").src="pic.jpg";
---stament2---;
}
document.getElementById("img").onerror="func2()";
In other browser, if there is no pic.jpg, func2()
is executed and AFTER that, stament2
is executed; in opera if there is an error loading the image, func2()
is executed after stament2.
Why did they did it like this? Is there any advantage? IS THERE A WAY to make it run the function called by onerror right when it's called and not after other statements?
if someone could please help....
Does jquery or other library have a crossbrowser solution for onerror applied to images? hmmm...must learn some jquery
thanks