I think there is something I don’t understand about same origin limitation for XMLHttpRequest.
Instead of forbidding Javascript code to send http request to different hosts (something that is really annoying for legitimate uses) wouldn’t have been better to just allow the request but not sending or accepting cookies in that case?
Forbidding a specific script to get something that literally everyone else in the internet can get seems to me at a first sight a quite weird choice…
What am I missing?
That is what Cross-Origin Resource Sharing (CORS) specifies.
It took web-standards bodies a while to realize that people would want to write serious JavaScript heavy applications. Gmail changed all that but standards bodies like the W3C take a while to fill functionality holes.