I am calling Version One REST API and keep getting XMLHttpRequest cannot load https://www10.v1host.com/... Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
javascript error. I am sending GET request and XML content is expected to be returned in response. This is my jQuery code:
$.ajax({
dataType: "xml",
url: "https://www10.v1host.com/...",
success: function(data, status, xhr) {
alert("Load was performed.");
}
});
I have changed dataType: "jsonp
" and with this I get response in this format:
jsonp1294354293197(<?xml version="1.0" encoding="UTF-8"?><Asset ...</Asset>)
But get another javascript error: "Uncaught SyntaxError: Unexpected token <
"
Is there a way how to get cross domain XML rest data (something like XMLp) or do a workaround for jsonp (prevent parsing JSON format and use my own - parse XML)?