/** !FACEBOOK JS WITH SUBSCRIBE EVENT **/ window.fbAsyncInit = function() { FB.init({ appId: '798296716878672', autoLogAppEvents: true, status: true, cookie: true, xfbml: true, oauth: true, version: 'v2.12' }); FB.Event.subscribe('comment.create', comment_create); FB.Event.subscribe('comment.remove', comment_delete); var sharecount_exist = $(document).find('.share-aggregator a'); if(sharecount_exist.length > 0) { FB.Event.subscribe('edge.create', function(response) { $('.share-aggregator a[data-url="'+response+'"]').each(function() { var count = $(this).html(); $(this).html(parseInt(count) + 1); }); }); } }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/it_IT/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); /* (function(d) { var js, id = 'facebook-jssdk'; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/it_IT/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); */