Facebook喜欢按钮状态更新 [英] Facebook like button status update

查看:134
本文介绍了Facebook喜欢按钮状态更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一页面上有一个像按钮和一个登录按钮。该页面在Facebook的iframe之外。如果我没有登录并通过登录按钮登录,则按钮状态不会更新。但如果我没有登录并通过类似按钮登录,则登录按钮将被更新。当我发现window.fbAsyncInit被关闭时,从我可以告诉的类似按钮似乎无法接收更新。



当我通过页面上不同的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆