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

后端 未结 7 2552
醉酒成梦
醉酒成梦 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:28

    Load it after the window loads, this is what works for me:

    $(window).load(function(){
         $.getScript('http://connect.facebook.net/en_US/all.js', function() {
              try{
                    FB.XFBML.parse();
                } catch(ex) {}
          });
    });
    

提交回复
热议问题