WordPress.org

Ready to get started?Download WordPress

Forums

WP-FB-AutoConnect
[resolved] Not Loading Asynchronously (3 posts)

  1. optimistguide
    Member
    Posted 2 years ago #

    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 http://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: 'http://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?

    http://wordpress.org/extend/plugins/wp-fb-autoconnect/

  2. justin_k
    Member
    Plugin Author

    Posted 2 years ago #

    How exactly did you determine that it's not loading asynchronously?

    By the way, primary support for this plugin is here: http://www.justin-klein.com/projects/wp-fb-autoconnect

  3. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    Closing this due to lack of response.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic