Is there a XDomainRequest equivalent in Firefox?

前端 未结 2 651
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 18:39

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.

2条回答
  •  梦如初夏
    2021-02-05 18:58

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

    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.

    More info here: http://www.w3.org/TR/cors/ and at /TR/XMLHttpRequest2 on the W3C website.

提交回复
热议问题