You need to sign in to do that
Don't have an account?
Riyaz Khan
CORS header 'Access-Control-Allow-Origin' missing error
I have tried to get json response from public salesforce API 'https://na1.salesforce.com/services/data/'. When I use HTTP/REST tool its working fine and return string as json. But when I am tring to call public API through jQuery AJAX request and giving following error:
"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://na1.salesforce.com/services/data/. (Reason: CORS header 'Access-Control-Allow-Origin' missing)."
Please provide the solution how can I call API from simple HTML page using AJAX request.
"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://na1.salesforce.com/services/data/. (Reason: CORS header 'Access-Control-Allow-Origin' missing)."
Please provide the solution how can I call API from simple HTML page using AJAX request.
In Spring '15 Salesforce began offering CORS whitelisting. You can specify the domain that is serving your script as a trusted resource through the UI by following the instructions here: https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/extend_code_cors.htm
Best,
Scott