How is it possible that when I try to make an XMLHTTPRequest from a javascript file to a web service located on the very same domain, I get:
Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin ???
If I change mydomain.com to localhost, I no longer have problems, but I would like to keep it as mydomain.com
What do I have to edit, and why in the first place, since it's the same domain?
1) look in your request/response headers. Is the server returning a weird access-control-allow-origin
header?
2) It's not just the domain, it's also the protocol (http vs https vs ftp etc), the port (if you have a :8080 or something like that), and potentially the part after the .com/