I have a webpage with iframes.
These iframes are for showing some external website data.
But problem arise when those external servers get blocked in a network it gives a error that “The proxy server is refusing connections”.
It does not look good to me.
I want to hide all these blocked iframes or want to show some alternate data there.
It’s not possible to check whether a page has not loaded. However, it’s possible to use
onloadevent handlers.It’s important to not rely on JQuery, because JQuery is also an external source which has to be loaded. Add this code within
<script>tags after the last IFRAME element (often, at the end of the body). Code:Fiddle: http://jsfiddle.net/3vnrg/
EDIT
Your proxy seems to send HTTP pages with status code 200. Another option is to include the CSS file, and check whether a CSS variable exists or not:
HTML:
JavaScript (execute this code after all resources have been loaded):