Facebook iFrame 应用程序:如何从 URL 查询字符串传递数据 [英] Facebook iFrame application: How to pass data from URL Query String

查看:26
本文介绍了Facebook iFrame 应用程序:如何从 URL 查询字符串传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有图片库的 Facebook 应用程序.它是在 Flex 4 中构建的.我想允许用户链接到特定图像.

I have a Facebook application that has a picture gallery. It's build in Flex 4. I want to allow users to link to a specific image.

这怎么办?

我看到这样做的唯一方法是在 Facebook 页面 URL 中添加像 &my_picture=asd.jpg 这样的 GET var,但我不知道如何从 iFrame 中读取它.

The only way I see this being done is adding a GET var like &my_picture=asd.jpg in the Facebook page URL, but I don't know how to read that from the iFrame.

推荐答案

是的,您可以为此向查询字符串添加参数:

Yes, you can add a parameter to the querystring for this:

http://app.facebook.com/yourapp?myparam=1234

然后,您的应用将被这样调用:

Then, your app will be called like this:

http://domainwhereyouhostyourapp.com/your_fb_app/index.php?myparam=1234

其他一些参数也由 facebook 传递,大多数与身份验证令牌等相关.它们以fb_"为前缀以防止名称冲突.

Some other parameters are passed by facebook as well, most related to auth tokens, etc. They are prefixed by "fb_" to prevent name clashes.

在您的 index.php(或您正在使用的任何文件)中,读取您感兴趣的 get 参数并照常将它们传递给您的 swf.

In your index.php (or whatever you are using), read the get parameter you're interested in and pass them to your swf as usual.

这篇关于Facebook iFrame 应用程序:如何从 URL 查询字符串传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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