Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FB.XFBML.parse Uncaught [object Object]

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]

like image 849
mitch Avatar asked Jan 27 '26 11:01

mitch


1 Answers

Ok, I found the solution. I don't know why but this works:

FB.XFBML.parse($(this).get(0));
like image 62
mitch Avatar answered Jan 29 '26 23:01

mitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!