This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 15th, 2012  |  syntax: None  |  size: 2.03 KB  |  views: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. window.fbAsyncInit = function() {
  2.     FB.init({
  3.         appId:  'myAppId',
  4.         status: true,
  5.         cookie: true,
  6.         xfbml:  true,
  7.         oauth: true
  8.     });
  9.  
  10.     FB.Event.subscribe('comment.create',
  11.         function (response) {
  12.             console.log('create', response);
  13.         });
  14.     FB.Event.subscribe('comment.remove',
  15.         function (response) {
  16.             console.log('remove', response);
  17.         });
  18.  
  19. };
  20. (function() {
  21.     var e = document.createElement('script'); e.async = true;
  22.     e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
  23.     document.getElementById('fb-root').appendChild(e);
  24. }());
  25.        
  26. <fb:comments class="fb-comments" href="myFirstCommentUniqueURL" data-num-posts="2" data-width="440"  notify="true"  migrated="1"></fb:comments>
  27. <fb:comments class="fb-comments" href="mySecondCommentUniqueURL" data-num-posts="2" data-width="440"  notify="true"  migrated="1"></fb:comments>
  28. <fb:comments class="fb-comments" href="myThirdCommentUniqueURL" data-num-posts="2" data-width="440"  notify="true"  migrated="1"></fb:comments>
  29. <fb:comments class="fb-comments" href="myFourthCommentUniqueURL" data-num-posts="2" data-width="440"  notify="true"  migrated="1"></fb:comments>
  30.        
  31. <script>
  32. //INCLUDE THE SCRIPT FIRST
  33. (function(d, s, id) {
  34.   var js, fjs = d.getElementsByTagName(s)[0];
  35.   if (d.getElementById(id)) return;
  36.   js = d.createElement(s); js.id = id;
  37.   js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={YOURAPPID}";
  38.   fjs.parentNode.insertBefore(js, fjs);
  39. }(document, 'script', 'facebook-jssdk'));
  40.  
  41.  
  42. //INITIALIZE THE OBJECTS
  43. window.fbAsyncInit = function() {
  44.     FB.init({
  45.         appId:  '{YOURAPPID}',
  46.         status: true,
  47.         cookie: true,
  48.         xfbml:  true,
  49.         oauth: true
  50.     });
  51.  
  52.     //AND THOSE WILL FIRE THE EVENTS :)
  53.  
  54.     FB.Event.subscribe('comment.create',
  55.         function (response) {
  56.             console.log('create', response);
  57.         });
  58.     FB.Event.subscribe('comment.remove',
  59.         function (response) {
  60.            console.log('remove', response);
  61.         });
  62.  
  63. };
clone this paste RAW Paste Data