How to use the Facebook FBML button on a page loaded via Ajax?

I have a piece of content that I upload through Ajax , and on this page I have a FBML share button. I also tried it without FBML and just used the hyperlink and script tag. When I download content directly, the share button loads normally, but when I download it through Ajax, the button does not appear. Any ideas on how to make the Share Share button work?

+3
source share
2 answers

I believe that after your content has been inserted, you need to call FB.XFBML.Host.parseDomTree () . This will force the JS Facebook libraries to scan the XFBML tags and display them.

+6
source

use this javascript function;)

fb_sharepro_render()
+2
source

Source: https://habr.com/ru/post/1724457/


All Articles