Is there a way I can find whether there's an http error status inside an iframe?
I'm loading the iframe with a dynamically built url and am removing a loading gif on load.
$("#reportFrame").load(function () {
kendo.ui.progress($("#report-container"), false)
$('#btnReportRefresh').removeAttr('disabled').removeClass('k-state-disabled');
$(this).css('display', 'block');
});
All of this is ok, but in the event of an error inside this page, I would like to show my own error text rather than what gets shown inside the iframe.
Is this possible?
UPDATE Note that the iframe will always be loaded on a different domain.
I don't believe this is possible in the way you're hoping, but what about an interval that checks the contents? Something like:
setInterval(function() {
if ($("#reportFrame body").html() === "This is an error page") {
// Do Something
} else {
//Do something else
}, 500)
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