在Firefox中是否有XDomainRequest等效项? [英] Is there a XDomainRequest equivalent in Firefox?

查看:149
本文介绍了在Firefox中是否有XDomainRequest等效项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firefox或任何其他浏览器中,有相当于Internet Explorer的XDomainRequest吗?

Is there an equivalent to Internet Explorer's XDomainRequest in Firefox or any of the other browsers?

我想访问我的域外的服务/网站。

I'd like to access a service/website outside of my domain.

推荐答案

Internet Explorer 8中的XDomainRequest对象是用于请求同源策略之外的资源的专有方法。

The XDomainRequest object in Internet Explorer 8 is a proprietary method for requesting resources which are outside the "same-origin policy."

Firefox 3.5+和Safari 4+允许通过XMLHTTPRequest对象发出跨域请求。支持XMLHTTPRequest Level 2的用户代理必须具有跨源资源共享支持(CORS),如果资源声明可以从其他域请求资源,则允许检索资源。

Firefox 3.5+ and Safari 4+ allow cross-domain requests through the XMLHTTPRequest object. User agents that support XMLHTTPRequest Level 2 must have Cross-Origin Resource Sharing support (CORS), which allows retrieving the resource IF the resource announces that it can be requested from other domains.

请记住,在合规用户代理将检索资源之前,资源必须将其自身声明为跨源资源。

Keep in mind that the resource must declare itself as a cross-origin resource before a compliant user agent will retrieve the resource.

更多信息:
http://www.w3.org/TR/cors/
位于W3C网站上的 / TR / XMLHttpRequest2

这篇关于在Firefox中是否有XDomainRequest等效项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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