‎2014 Feb 06 10:43 AM
Hi Experts,
Please need a help when I am consuming web service in java script.
Error: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Thanks in advance.
‎2014 Feb 07 5:43 AM
It's a CORS error and in a nutshell, it looks like you may not have included 'Access-Control-Allow-Origin' in your request header. So I would try this first.
Secondly your server may not accept cross origin requests. You may need to get the domain of your originating site added to the list of acceptable domains on that server for requests to that service. I think it also rejects changes in protocol as cross origin, so HTTP making a HTTPS request is not allowed. So watch out for that.
You can find out a bit more about over here
Same-origin policy - JavaScript | MDN
https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
It may just be a problem, if you are testing on a local deployment as your local host will definitely be defined.
Hope that makes sense. If you are working in JS and using AJAX, you need to understand this, so take the time to.
Regards
Katan