Created
May 30, 2014 20:42
-
-
Save ryanjbonnell/6d76c38cb8bd90939f67 to your computer and use it in GitHub Desktop.
Load the Facebook JavaScript SDK Asynchronously
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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