We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b4de80 commit 3329810Copy full SHA for 3329810
src/Facebook.js
@@ -60,21 +60,17 @@ export default class Facebook {
60
resolve(window.FB);
61
};
62
63
- const fjs = window.document.getElementsByTagName('script')[0];
64
- if (!fjs) {
65
- return;
66
- }
67
-
68
if (window.document.getElementById('facebook-jssdk')) {
69
return;
70
}
71
72
const js = window.document.createElement('script');
73
js.id = 'facebook-jssdk';
74
js.async = true;
+ js.defer = true;
75
js.src = `https://${domain}/${language}/sdk${debug ? '/debug' : ''}.js`;
76
77
- fjs.parentNode.insertBefore(js, fjs);
+ window.document.body.appendChild(js);
78
});
79
80
return this.loadingPromise;
0 commit comments