Why FB.XFBML.parse() doesnt render my plugin?

前端 未结 2 1629
走了就别回头了
走了就别回头了 2021-01-06 11:19

My code :

Render me
​ $(\'#render-me\').click
相关标签:
2条回答
  • 2021-01-06 12:08

    Try to add this markup

    <div id="fb-root"></div>
    

    in bottom of page and make sure you are added FB script. Please have a look the image

    enter image description here

    Please follow these steps you will able to solve you problem.

    For more info please go through this link https://developers.facebook.com/docs/reference/plugins/like/

    0 讨论(0)
  • 2021-01-06 12:10

    You have to specify a node already in DOM. So, you can't use:

    FB.XFBML.parse(document.getElementById('button-facebook'));
    

    use instead:

    FB.XFBML.parse(document.getElementById('social-facebook'));
    

    and it will work fine ;)

    0 讨论(0)
提交回复
热议问题