I am implementing a CORS function to get a JSON object from a cross domain.
But I still see this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource."
Do I need to do something in the server?
I am implementing a CORS function to get a JSON object from a cross domain.
But I still see this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource."
Do I need to do something in the server?
Yes you need to make the server send the right headers. With these headers the browser will be able to tell that the request is valid. You need at least this header:
Access-Control-Allow-Origin: http://yourserver.com
And maybe this one if you need to handle cookies:
Access-Control-Allow-Credentials: true