[Plugin: WP-FB-AutoConnect] Not Loading Asynchronously
-
The Facebook Connect javascript is not loading asynchronously for me. Although, it looks like it should be based on the code it creates. Facebook Connect’s support, at https://developers.facebook.com/blog/post/530/, shows how to set up the script correctly.
Your plugin creates the following code:
<div id="fb-root"></div> <script type="text/javascript">window.fbAsyncInit = function() { FB.init({ appId: '338982446159202', status: true, cookie: true, xfbml: true, oauth:true, channelUrl: 'https://www.anthonysabilities.com/blog/wp-content/plugins/wp-fb-autoconnect/facebook-platform/channel.html' }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }());</script>
Facebook says to code like this:
<div id="fb-root"></div> <script> /* All Facebook functions should be included in this function, or at least initiated from here */ window.fbAsyncInit = function() { FB.init({appId: 'your app id', status: true, cookie: true, xfbml: true}); FB.api('/me', function(response) { console.log(response.name); }); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script>
Any idea of why the script in your plugin is not loading asynchronously?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: WP-FB-AutoConnect] Not Loading Asynchronously’ is closed to new replies.