Closed swaroopjo closed 9 years ago
Hi @swaroopjo, please see #9 for the details on this API and CORS.
One way of solving this would be to ask for jsonp returns. If you're using the convenient jQuery ajax method you can just change the dataType:"json" to dataType:"jsonp" and your request url to the following:
:+1: what @ETNOL said
Thank you all. This works with JsonP. I am still using angularJS though. Here's what i have done.
var JSON_CALLBACK = function(response){
console.log("Callback function called");
//showResult(response)
};
$http.jsonp("http://dev.markitondemand.com/Api/v2/Lookup/jsonp?input=G&&callback=JSON_CALLBACK")
.success(function(response){
console.log("Data Received: "+response);
showResult(response)
})
.error(function(){
console.log("Error Occured !!.");
});
Nice @swaroopjo, thanks for updating us
I have been developing a test application using angular JS but getting this error on Chrome and Firefox. Internet explorer seems to work fine though. I looked at some blogs tried to modify the Http headers from the client side but no luck.
Here is the full error from firefox : Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://dev.markitondemand.com/Api/v2/Lookup/json?input=G. (Reason: CORS header 'Access-Control-Allow-Origin' missing).