Why am I encountering an issue when attempting to make an XMLHTTPRequest from a JavaScript file to a web service on the same domain, resulting in:
Access-Control-Allow-Origin error stating that the origin is not allowed?
Switching mydomain.com to localhost resolves the problem, but I prefer to use mydomain.com. What changes should I make and why is this issue occurring despite being on the same domain?