How to add a Facebook “Like” button to an AJAX driven page

后端 未结 7 2506
醉酒成梦
醉酒成梦 2020-12-02 07:14

I have trawled the net and Stack Overflow and have not found an adequate answer to this question. Before I start the trial and error process of finding my own solution, I th

7条回答
  •  时光取名叫无心
    2020-12-02 07:21

    SIMPLE SOLUTION

    Just parse trigger the parse function when load complete.

    If you’re using jQuery, there’s a real easy and slick solution to this problem:

    $(document).ajaxComplete(function(){
        try{
            FB.XFBML.parse(); 
        }catch(ex){}
    });
    

    http://developers.facebook.com/docs/reference/plugins/like/

提交回复
热议问题