如何在Facebook页面的iframe选项卡上捕获JavaScript事件 [英] How to capture JavaScript events on a Facebook page's iframe tabs

查看:127
本文介绍了如何在Facebook页面的iframe选项卡上捕获JavaScript事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算在我的粉丝页面的Facebook标签页面中创建一些动态内容。如果访问者不是粉丝,则应显示内容,然后单击赞按钮,更改内容以显示隐藏的胡萝卜(隐喻)。是否有可能从iframe中捕获点击的情况下,对Like按钮?

I am planning to create some dynamic content in a Facebook tab for my fan page. It should have content displayed if the visitor is not a fan, and then upon them clicking the Like button, changing the content to display hidden carrots (metaphorically). Is it possible to capture the event of the click on the Like button from inside the iframe?

推荐答案

在一个Facebook粉丝页面,当用户点击Like按钮时,整个页面会重新加载,Facebook会使用名为signed_request的参数向您的网站发送HTTP帖子,您需要解码并查看服务器代码,而不是javascript。这显然取决于你使用的是什么语言的代码进行解码,但过程是记录在Facebook网站上。解码后,您需要查看page.liked值。

On a Facebook fan page, when the user clicks the Like button, the whole page gets reloaded and Facebook sends an HTTP post to your website with a parameter called signed_request that you would need to decode and look at with server code, not javascript. The code to decode it will obviously vary depending on what language you are using, but the process is documented on Facebooks site. Once decoded, you will need to look at the page.liked value.

这篇关于如何在Facebook页面的iframe选项卡上捕获JavaScript事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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