I\'m using the Facebook JS sdk, and I have created a new App today. Everything is configured properly. Using init function like:
window.fbAsyncInit = functio
https:// in the URLjs.src = "https://connect.facebook.net/en_US/sdk.js";
I would not have believed this either, but the only difference between what Facebook has in their current sample code and what I have is https:// instead of // for the url.
Updating to be https:// seems to have fixed it for me and I cannot duplicate the error.
Also if you're doing any checks elsewhere in your code to see if FB is defined make sure to check if (window.FB) and not if (FB) or you will get an error.
// call after manually adding DOM nodes containing FB widgets
if (window.FB)
{
window.FB.XFBML.parse()
}
If you're using typescript you need to add something like this:
interface Window
{
FB: IFacebook;
}
interface IFacebook
{
XFBML: any;
ui: any;
getLoginStatus(callback: (response: { status: string }) => any);
login(callback: (response) => any, options: any);
logout(callback: () => any);
Event: any;
api(url: string, callback: (response: any) => any);
}