weixin_33708432 2017-04-25 00:57 采纳率: 0%
浏览 30

Ajax请求子域

A page is served from application.dev

That page has some JS that makes an AJAX request to: api.application.dev

Does a request to a subdomain count as a Cross-domain request? Are we thinking the wrong way here?

  • 写回答

1条回答 默认 最新

  • 七度&光 2017-04-25 01:02
    关注

    MDN has excellent details on this at https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

    The info there seems to indicate that this would be considered cross-domain. The real-world answer may depend on the browser. Best suggestion is "try it yourself" with a simple page in several browsers to see what happens.

    评论

报告相同问题?