Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6616727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:37:05+00:00 2026-05-25T20:37:05+00:00

I have a webpage with iframes. These iframes are for showing some external website

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:37:05+00:00Added an answer on May 25, 2026 at 8:37 pm

    It’s not possible to check whether a page has not loaded. However, it’s possible to use onload event 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:

    //Cannot rely on JQuery, as it has to be loaded
    (function(){//Anonymous wrapper.
        var iframes = document.getElementsByTagName("iframe");
        var num_frames = iframes.length;
        //Function to add Event handlers
        var addLoad = window.addEventListener ? function(elem, func){
            elem.addEventListener("load", func, true);
        } : window.attachEvent ? function(elem, func){
            elem.attachEvent("onload", func);
        } : function(elem, func){
            elem.onload = func;
        };
        var success_load = 0;
        for(var i=0; i<num_frames; i++){
            addLoad(iframes[i], function(){
                this.dataSuccessfullyLoaded = true;
                success_load++;
            });
        }
        addLoad(window, function(){
             if(success_load < num_frames){
                 for(var i=num_frames-1; i>=0; i--){
                     if(!iframes[i].dataSuccessfullyLoaded){
                         iframes[i].parentNode.removeChild(iframes[i]);
                         //Or: iframes[i].style.display = "none";
                     }
                 }
             }
        });
    })();
    

    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:

    /*From http://static.ak.fbcdn.net/rsrc.php/v1/yb/r/CeiiYqUQjle.css*/
    #facebook .hidden_elem{display:none !important}
    #facebook .invisible_elem{visibility:hidden}
    

    HTML:

    <link rel="Stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/v1/yb/r/CeiiYqUQjle.css" />
    <div id="facebook"><div class="hidden_elem invisible_elem"></div></div>
    

    JavaScript (execute this code after all resources have been loaded):

    if($("#facebook div").css("display") != "none" || $("#facebook div").css("visibility") != "hidden") disableFBFrame();
    // Where disableFBFrame(); is a function which hides the frame.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several iFrames that load an external webpage, although only 1 appears at
I have a script that dynamically loads iframes inside a webpage. You can see
I have a webpage that retrieves data (via ajax/php) and shows it in an
I have a bit of a problem. I made a blog for my webpage,
I am currently updating a webpage that has some very simple data displayed in
I have a webpage with an <iframe> pointing to another website. I don't want
I have a dynamic webpage that includes an iFrame where external html code is
I have a problem I could need some help with. I am working on
I have a webpage where I have an Iframe. When someone clicks something in
I have an iframe embedded on my webpage and I'd like to edit certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.