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

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

    If you're using the jQuery Mobile framework you can run the same code as the accepted answer in the pagecontainershow event which jQuery Mobile uses when it displays a new page.

    // initialize new pages
    $(document).on("pagecontainershow", (e, ui) =>
    {
        try
        {
            FB.XFBML.parse();
        } catch (ex) { }
    });
    
    0 讨论(0)
提交回复
热议问题