I am trying to set up a new Facebook Javascript API on my website, but I had a problem with Firefox (works fine with Chrome and Safari, but for full validation on IE, but was not informed about the lack of issues).
The problem is indicated at the beginning of the all.js file on Facebook, the message says:
window.name is undefined if(!window.FB)window.FB={_apiKey:null,...return document.getElementById(a);}}; all.js (line 3)
Therefore, any subsequent calls to the SDK using the FB. results in an error with a message
FB is not defined [Break On This Error] FB.login(function(response)
The code I used is
<div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'my_app_id',
};
// 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>
Any clues as to what the problem is? And has anyone encountered this error before?
javascript facebook facebook-javascript-sdk
Raveesh Bhalla Jan 08 2018-12-12T00: 00Z
source share