Speed up development with full-stack environments for every branch.

Learn More

Initialize the SDK on load [facebooksdk]

63 Runs 300 Views 58 Copies


sundip 66

published 4 years ago

  <title>Init the Facebook SDK</title>
<p>How to Initialize the Facebook SDK</p>

<script type="text/javascript">

// Load the Facebook JS SDK

   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);

// Initialize the SDK upon load
window.fbAsyncInit = function() {
    appId      : 'FACEBOOK_APP_ID', // App ID
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML

  // Add API calls here...
  // Facebook Docs: https://developers.facebook.com/docs/reference/javascript/
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).