I am getting the following error when making a AJAX call:
Uncaught SyntaxError: Unexpected token <
For <?xml version="1.0" encoding="UTF-8"?>
even though it is the expected response.
Is there a reason why its not processing this XML document properly? How do I wrap the response so it can parse it correctly? Here is my code:
$.ajax({
type: 'GET',
url: url,
dataType: 'jsonp',
beforeSend: function(xhr) {
xhr.setRequestHeader('Content-Type', 'application/vnd.cpc.manifest-v3+xml');
xhr.setRequestHeader('Accept', 'application/vnd.cpc.manifest-v3+xml');
},
error: function () {},
success: function(data) {
console.log('Success!');
}
});