Facebook Social Plugin and jQuery Issue

前端 未结 1 1896
一个人的身影
一个人的身影 2021-01-29 03:32

I\'m using jQuery to load some content into a lightbox-like div in a web app I\'m working on. Using $POST, I\'m calling a dynamically populated page that holds a youtube video a

1条回答
  •  隐瞒了意图╮
    2021-01-29 04:13

    When you load the first page, the Facebook JS SDK get’s loaded as well, and parses the XFBML tags in your document.

    The next time you AJAX-load a page into your document, the JS SDK is already embeded into your document, so nothing further happens – and that includes no new parsing of XFBML tags.

    You have to use FB.XFBML.parse to tell the SDK that it should again search the document for (dynamically added) XFBML tags. (Preferable give it a DOM node as first parameter, so that it does not search the whole document again, but just the part where dynamic changes have occured.)

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