Christophe
Christophe

Reputation: 2200

Sub domain and same origin policy

Let's say that I own 2 domains www.xyz.com and ajax.xyz.com. I'd like to load my HTML and javascript from the site with prefix www and then execute an ajax request to the site prefixed with ajax. Will the same origin policy block my ajax request from www.xyz.com to ajax.xyz.com or will it work without using the Access-Control-Allow-Origin header.

Regards

Upvotes: 0

Views: 750

Answers (1)

cwurtz
cwurtz

Reputation: 3257

Subdomains are considered different domains, you'll have to set the CORS headers

Upvotes: 2

Related Questions