Search the Community
Showing results for tags 'Loading likes and reactions'.
-
Hey everyone! I am now very frustrated with this code, been on it for hours trying to get it to work. And have searched everywhere for a good tutorial or example on how to connect to fb, but it just won't work with this FB graph library, It loads the like feature GUI, from the SDK CSS "compiler" but it won't recognize the FB.api load. and says no fb sdk loaded anyway so my debugging feature kinda mess my head up even more.. Also this is basically copy and paste from Facebooks own developer guiding sites and the FB.api bit is directly from the copy board of a tested api get call on fbs own dev site so I am as lost as I can get.. What I want to get is basically the output of likes which, if this was working would be returned as a json response here's my code: <html><head> <script> window.fbAsyncInit = function() { FB.init({ appId : 'myappid', xfbml : true, version : 'v2.8' }); }; (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 = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); if (typeof(FB) != 'undefined' && FB != null ) { FB.api( '/mypost/reactions', 'GET', {}, function(response) { document.getElementById("content").innerHTML = response; } ); } else { alert("no fb sdk loaded"); } </script> </head> <body> <div id="content"></div> <div class="fb-like" data-share="true" data-width="450" data-show-faces="true"> </div> </body> </html> Thanks for any help, link, or whatever you've got! Kristian
- 5 replies
-
- Loading likes and reactions
-
(and 3 more)
Tagged with: