如何从其他域Ajax响应?Ajax

2023-09-11 00:52:26 作者:多年以后

除了YQL,有没有什么办法让阿贾克斯的其他域响应和数据,而无需修改服务器端的code?

Except YQL ,Is there any way to get ajax's response and data from other domain without modifying server side's code?

YQL有限制(每小时1000调用)的免费用户,但大多数的人说,它实际上更小。

YQL has limit (1000 calls per hour) for free user , but most of people said it's actually less.

推荐答案

如果你用的,而无需修改服务器端的code的不修改数据源的服务器,那么意味着你可以有你自己的代理服务器(基本上是使自己的YQL服务器)来读取远程数据。这可能是因为服务器端未绑定到同源策略。

If what you mean by "without modifying server side's code" is not modifying the server of the data source, then you can have your own proxy server (basically making your own YQL server) to read the remote data. This is possible because the server-side is not bound to the Same-Origin Policy.

所以,你可以AJAX您的服务器,然后让你的服务器读取使用某种形式的的wget 卷曲或的fopen ,并返回什么检索:

So you can AJAX your server, then let your server read the remote server using some form of wget, curl or fopen, and return what was retrieved:

Remote server <- fopen, curl or wget -> your server <- AJAX -> browser