如何从其他域Ajax响应? [英] How to get ajax response from other domain?

查看:110
本文介绍了如何从其他域Ajax响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了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

这篇关于如何从其他域Ajax响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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