How to update Facebook comment content during AJAX navigation

I want to place the Facebook comment box on a page where navigation is based on AJAX. How can I bring up the Facebook comment box to display the newly loaded AJAX page?

Example: Users visiting example.com?page=1, loading comments for example.com?page=1. The user clicks a link that refreshes the page to display page content = 2, load comments for page = 2.

+3
source share
1 answer

In the click handler for loading ajax pages, you can replace the comment code in facebook with the code for new pages

<fb:comments href="example.com" num_posts="2" width="500"></fb:comments>    

Replace example.com with the URL of the page. Also, this refers to the header:

<script src="http://connect.facebook.net/en_US/all.js#appId=188677664483920&amp;xfbml=1"></script>

: API facebook xfbml , FB.XFBML.parse();

, , .

+7

All Articles