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 6829925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:33:27+00:00 2026-05-26T22:33:27+00:00

In Internet Explorer <9, at least, linking to a blocked resource (due to firewalls,

  • 0

In Internet Explorer <9, at least, linking to a blocked resource (due to firewalls, WebSense, etc.) will return an error. For instance, if Facebook is blocked, linking to the Facebook SDK JavaScript file will result in an error in Internet Explorer.

Is it possible to test if a website is blocked in JavaScript, before linking to the external JavaScript file, for the following purposes:

  1. Prevent a JavaScript error from showing up in Internet Explorer
  2. If code depends on the external file, it can be prevented from running, to cause further JavaScript errors relating to the lack of the external library
  • 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-26T22:33:28+00:00Added an answer on May 26, 2026 at 10:33 pm

    Looking at the facebook SDK, looks like it gets injected asynchronously by inserting a script element into the head. This means all you have to do is create the callback handler and if facebook is blocked then that will never be called. You shouldn’t get any browser script error. So you should be able to do something like:

    <div id="fb-root"></div>
    <script>
      var FACEBOOK_BLOCKED = true;
      window.fbAsyncInit = function() {
        FACEBOOK_BLOCKED = false;
        FB.init({
          appId      : 'YOUR_APP_ID', // App ID
          channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          oauth      : true, // enable OAuth 2.0
          xfbml      : true  // parse XFBML
        });
    
        // Additional initialization code here
      };
    
      // Load the SDK Asynchronously
      (function(d){
         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
       }(document));
    </script>
    

    For a more general use case, a similar approach will work with any script that you can call using a JSON-P approach. This, of course, requires that the server takes a callback function as a parameter (or automatically calls a pre-named function):

    // Load some SDK Asynchronously
    (function(d){
        var js = d.createElement('script');
        js.src = "http://www.example.com?callback=myfunc";
        d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
    
    var SCRIPT_LOADED = false;
    var myfunc = function() {
       SCRIPT_LOADED = true;
    }
    

    UPDATE

    Just came across this method, you might want to give it a shot:

    function loadScript(sScriptSrc, oCallback) {
        var oHead = document.getElementById('head')[0];
        var oScript = document.createElement('script');
        oScript.type = 'text/javascript';
        oScript.src = sScriptSrc;
        // most browsers
        oScript.onload = oCallback;
        // IE 6 & 7
        oScript.onreadystatechange = function() {
            if (this.readyState == 'complete') {
                oCallback();
            }
        }
        oHead.appendChild(oScript);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As is known, Internet Explorer (at least <= 8) does not support several javascript
This code giving error in IE Internet Explorer Cannot Open the Internet Site Operation
Within the last day, in Internet Explorer 8, the developer tools window will not
Internet Explorer (from versions 4 to 7, at least) limits the number of files
I am receiving and stop running this script error in Internet Explorer 9.0 ,
Is anyone else aware of the fact that Internet Explorer (at least version 8)
I've had problems with Internet Explorer not applying the last property in a list
Internet Explorer is giving me a serious headache... What I want to do is
internet-explorer aborts the EOT file loading progress sometimes, so the font does not load
Internet Explorer does not like my Jquery selector. Not sure if it's my weak

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.