While executing this below Dojo code the call back mehod is calling the onFailure.
But if i will do
console.warn("Resp Code:"+ioargs.xhr.status);
It gives me 200 as status code why this is happening,it should go to the load but it is calling the error.
dojo.xhrGet({ preventCache : "true",
url : path,
sync:true,
load : onSuccess,
error : onFailure,
handleAs : "json"
});
More than likely, since you’ve told the request to handle the response as json, the response you are getting back is not actually json, which can generate the error. From the Live Docs @ dojotoolkit.org:
Make sure the response is sending back valid JSON and the server is sending it as the application/json content-type, otherwise set your handleAs to text.