Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell
Created May 30, 2014 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanjbonnell/6d76c38cb8bd90939f67 to your computer and use it in GitHub Desktop.
Save ryanjbonnell/6d76c38cb8bd90939f67 to your computer and use it in GitHub Desktop.
Load the Facebook JavaScript SDK Asynchronously
<div class="fb-like-box"
data-href="https://www.facebook.com/FacebookDevelopers"
data-colorscheme="light"
data-show-faces="true"
data-header="true"
data-stream="false"
data-show-border="true"
data-height="212">
</div>
<script src="//code.jquery.com/jquery-latest.min.js"></script>
<script>
( function( window, $, undefined ) {
// Load the Facebook JavaScript SDK Asynchronously
// https://developers.facebook.com/docs/plugins/like-box-for-pages
jQuery.ajax({
url: '//connect.facebook.net/en_US/all.js',
dataType: 'script',
cache: true
}).done(function () {
$('body').prepend( '<div id="fb-root"></div>' );
FB.init({
appId: '278620438980885',
status: false,
cookie: true,
xfbml: true
});
});
} )( window, jQuery );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment