Inserting fb:comments with javascript

霸气de小男生 提交于 2019-12-04 11:15:54

FB:Root should be a part of the page at build time, and use the Javascript provided by FB to asynchronously load Facebook JS libraries on document load....just like FB describe.

Then, insert the FB comments using

document.getElementById('theplace').innerHTML="<fb:comments blah blah blah></fb:comments>"

and THEN

FB.XFBML.parse(document.getElementById('theplace'));

This bit of code will initialise the FB:Comments.

You can see a working example of this on my page at Track Vision - races page I spent a while sweating on this code, but it's all functional now! FB documentation is shocking!

All the best

I was able to solve the problem calling FB.XFBML.parse on an onLoad() callback

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!