Render multiple facebook 'like' buttons after ajax call
Asked Answered
Z

0

1

As a follow up to Render-like-button-after-ajax-call, I'm having an issue with rendering multiple "like" buttons on a webpage.

I want to get the ids of all posts from Facebook, via JSON and JQuery, and then display boxes with like buttons for each... The problem is that simply calling "FB.XFBML.parse();" so I do something like this:

function displayPost(postJson)
{
$("#myelement").append(postJson.text+"<somehtmltags for like button>"+postJsonId);
FB.XFBML.parse();
}
regular ajax call
{
...
displayPost(postJson);
...
}

Edit: Now, this bit of code does ensure that future ajax calls display the like buttons, but the like buttons don't display the actual like count (how many people liked the post)... Any ideas ?

Zoara answered 29/6, 2012 at 3:48 Comment(3)
I have the same problem mate :S, only works with 1 buttonCaloric
I gave up on this some time ago but I'd still have lots of uses for an answer... Glad to know I'm not aloneZoara
Prolly has something to do with getting the 'like' count globally before the buttons are re-displayedZoara

© 2022 - 2024 — McMap. All rights reserved.