ryan-j
5/30/2014 - 8:42 PM

Load the Facebook JavaScript SDK Asynchronously

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>