I'm trying to use jquery to detect whether an iframe fails to load or the page doesn't exist, but the code below isn't working:
$('#frame').error(function(){
//code here
});
One of the comments on the documentation says:
Using .error() on an iframe never seems to trigger (even though .load() will trigger on a successful iframe load).
This event does not appear to be designed to work in this use case.
The answers to this question explain how to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With