summaryrefslogtreecommitdiff
path: root/fb/templates/fb_js.html
blob: da728ac1ff962db1722a8e207e6e35172575a913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId: '{{ FACEBOOK_APP_ID }}',
      status: true,
      cookie: true,
      xfbml: true
    });
    
    FB.Event.subscribe('auth.sessionChange', function(res) {
      if (res.session) {
        alert('authenticated!');
      }
    });
  };
  (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>