Reputation: 2245
Why this doesn't work ?
$('.fb-like-button').each (function(){
if ($(this).html() == "" || !$(this).html() || $(this).html() == "undefined")
{
$(this).html('<fb:like href="'+$(this).attr("data-url")+'" layout="button_count" send="false" show_faces="false" width="100" action="like" font="verdana" colorscheme="light" />');
FB.XFBML.parse($(this));
$(this).attr("class", "done");
}
});
Error: Uncaught [object Object]
Upvotes: 3
Views: 505
Reputation: 2245
Ok, I found the solution. I don't know why but this works:
FB.XFBML.parse($(this).get(0));
Upvotes: 2