Facebook喜欢按钮状态更新 [英] Facebook like button status update
问题描述
当我通过页面上不同的Facebook按钮登录时,是否有更新类似按钮的方法?
这是一个解决方法。
订阅 auth.statusChange
(http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/)并检查它是否是一个成功的登录。如果是这样,请将类似的按钮代码重新渲染到DOM中,然后让Javascript SDK使用 FB.XFBL.parse()
(http://开发人员)重新解析.facebook.com / docs / reference / javascript / FB.XFBML.parse /)
i have a like button and a log in button on the same page. the page is outside of a Facebook iframe. if i am not logged in and log in through the log in button the like button status doesn't get updated. but if i'm not logged in and log in via the like button the log in button gets updated. from what i can tell the like button doesn't seem to be able to receive the updates when window.fbAsyncInit is fired off.
is there a way to update the like button when i log in through a different Facebook button on the page?
Here's a work-around.
Subscribing to the auth.statusChange
(http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) and check to see if it is a sucessful login. If so, re-render the like button code into your DOM and then have the Javascript SDK re-parse it using FB.XFBL.parse()
(http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/)
这篇关于Facebook喜欢按钮状态更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!