每次Ajax调用后,不同的Facebook评论框不同、Ajax、Facebook

由网友(mm 禁心尽力°)分享简介:我的问题是这样的:我有一个每个用户点击该按钮时,改变网页。标题被更新,的曲线图。看到在页面现在有不同的内容,我很想有一个不同的注释部分。然而,网址是完全一样的(因为所有的内容都AJAX加载),所以我想知道是否有可能有一个新的FB评论框生成以及(它需要被生成,因为有数百个套内容,用户可以通过点击)?my proble...

我的问题是这样的: 我有一个每个用户点击该按钮时,改变网页。标题被更新,的曲线图。看到在页面现在有不同的内容,我很想有一个不同的注释部分。然而,网址是完全一样的(因为所有的内容都AJAX加载),所以我想知道是否有可能有一个新的FB评论框生成以及(它需要被生成,因为有数百个套内容,用户可以通过点击)?

my problem is this: I've got a webpage that changes each time the user clicks the button. The title is updated, a graph. Seeing as the page now has different content, I would love to have a different commenting section. However, the url is exactly the same (because all of the content is ajax loaded) and so I'm wondering whether it is possible to have a new FB comment box be generated as well (it would need to be generated because there are hundreds of sets of content that the user can click through)?

感谢。

推荐答案

是的,它可以生成一个新的注释框。

Yes it is possible to generate a new comment box.

在AJAX调用,您将需要从DOM删除旧的评论框,然后插入一个新的进入DOM,然后调用javascript函数 FB.XFBML.parse(); 来获取Facebook的重新呈现它。

After the AJAX call, you will need to remove the old comments box from the DOM, then insert a new one into the DOM and then call the javascript function FB.XFBML.parse(); to get Facebook to rerender it.

阅读全文

相关推荐

最新文章