title: Facebook FB.Init Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'
body: <p>Following the Facebook instructions, FB.Init in Chrome produces</p>
  
  <blockquote>
    <p>Refused to display '<a href="https://www.facebook.com/connect/ping" rel="nofollow noreferrer">https://www.facebook.com/connect/ping</a>?...' in a
    frame because it set 'X-Frame-Options' to 'DENY'.</p>
  </blockquote>
  
  <p>However, there are no frames on the page. IE, strangely enough, seems happy with the call.</p>
  
  <p>Based on a stackoverflow suggestion, I added </p>
  
  <pre><code>&lt;httpProtocol&gt;
      &lt;customHeaders&gt;
        &lt;add name="X-Frame-Options" value="SAMEORIGIN" /&gt;
      &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt; 
  </code></pre>
  
  <p>to <code>system.webServer</code></p>
  
  <p>to no avail.</p>
  
  <p>So something else is happening here. There seems to be a lot questions on SO relating to this problem, but with no clear solution.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;hello world&lt;/h1&gt;
  
  &lt;script&gt;
      // -----------------------------
      var FBinitialised = false;
  
       window.fbAsyncInit = function() {
          FB.init({
              appId      : '&lt;MY_APP_ID&gt;',
              cookie     : true,
              xfbml      : true, 
              version    : 'v2.8'
          });
  
          console.log( 'after FB.init');
  
          FB.getLoginStatus( function( response){
              FBinitialised = true;
              console.log( 'FBinitialised');
          });
      };
  
      // ---------------------------------
      // Load the SDK asynchronously
      (function(d, s, id){
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = '//connect.facebook.net/en_US/sdk.js';
          fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
  
      console.log( 'End of script');
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Anyone know what is going on?</p>