Render multiple facebook 'like' buttons after ajax call

谁说胖子不能爱 提交于 2019-12-13 01:29:38

问题


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 ?

来源:https://stackoverflow.com/questions/11255818/render-multiple-facebook-like-buttons-after-ajax-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!