我可以做一个XMLHtt prequest到另一个域? [英] Can I make an XMLHttpRequest to another domain?

查看:110
本文介绍了我可以做一个XMLHtt prequest到另一个域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用XMLHtt prequest结合其他领域?

Is there a way to use XMLHttpRequest in combination with other domains?

我想解析来自谷歌一些xml的,而不必使用一台服务器,以便它是minimalistically复杂运行

I would like to parse some xml from Google without having to use a server so it is minimalistically complex to run.

var req = getXmlHttpRequestObject();
...
req.open('GET', 'http://www.google.de/ig/api?weather=Braunschweig', true);
        req.setRequestHeader("Content-Type","text/xml");
        req.onreadystatechange = setMessage;
        req.send(null);

在服务器端做,就没有选择,至少我不会要问

Doing it on the server side is no option at least then I wouldn't have to ask

推荐答案

不,不是现在。我相信,我读了计划/设计的是在作品的标准组织的未来,所以我们可以安全地做到这一点。

Nope, not right now. I believe I read that plans/design's are in the works by standards groups for the future, so we can securely do this.

跨站点脚本漏洞会猖獗其他明智的。

Cross site scripting vulnerabilities would be rampant other wise.

JSONP 是一个可能的解决方案,如果其他网站API支持。

JSONP is a possible solution if the other sites API supports.

这篇关于我可以做一个XMLHtt prequest到另一个域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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