jQuery的阿贾克斯不工作的Facebook应用程序应用程序、工作、jQuery、阿贾克斯不

由网友(ゅ     陌若安生)分享简介:我想创建一个Facebook应用程序,所有工作正常,只是我用来填充从第一个选择框中选择的项的第二个框阿贾克斯的部分。I am trying to create a facebook application, all is working fine except the ajax part that I am usin...

我想创建一个Facebook应用程序,所有工作正常,只是我用来填充从第一个选择框中选择的项的第二个框阿贾克斯的部分。

I am trying to create a facebook application, all is working fine except the ajax part that I am using to populate a second box from the item selected in first select box.

我使用jQuery(V1.3.2)实现这个目标。这Ajax是工作,我已经采取了空间,它在主机上绝对没问题,但它不工作了Facebook。

I am using jquery (v1.3.2) for accomplishing this. This ajax is working absolutely fine on the host where I have taken space for it, but it is not working in facebook.

下面是我的问题,关于这个问题,

Here are my questions regarding to this problem,

在做画布页面URL必须是一样的,即我的应用程序名称。 (在我的情况是不同的)

我对父母选择框里面Facebook onchange事件收到此错误。

I am getting this error on the onchange event of parent select box inside facebook.

访问受限制的URI被拒绝code:1012

Access to restricted URI denied" code: "1012 在什么可能是错误的...?请帮我解决这个问题。

感谢

推荐答案

您不能从其他网站比脚本运行的域请求数据。例如,如果你正在运行脚本www.example.com/script.js,那么你可以在www.exaple.com域下,只有阿贾克斯的文件,而不是www.facebook.com。

You are not allowed to request data from other sites than the domain the script is running on. For example, if you are running the script www.example.com/script.js, then you can only ajax files under the www.exaple.com domain, not www.facebook.com.

有几种方法可以做到这一点:

There are a few ways to do it:

JSONP 是一种方式,但它要求 Facebook的回复与JSONP数据。不 知道它。在这里 JSONP 更多信息。 CSSHtt prequest (或AJACSS)是另一种方式。严重怀疑facbook使用此方法。 JSONp is a way, but it requires that facebook replies with jsonp data. Not sure if it does. More info on JSONp here. CSSHttpRequest (or AJACSS) is another way. Seriously doubt facbook uses this method.
阅读全文

相关推荐

最新文章