Noobie is here. I am writing a client script that should read an XML file from another domain. I tried to use JSONP. I get a 200 response, but for some reason the client cannot access the returned data. I get two errors:
Resource interpreted as Script but transferred with MIME type text/xml
and
Uncaught SyntaxError: Unexpected token <
Here's the code (I removed the XML URL as it is confidential):
$(document).ready(function() { $.getJSON("urlOfFilecallback=?", function(data) { console.log(data) }) });
When I try to display data in the console, I get:
ReferenceError: data is not defined
How can i fix this? Do I need to use a proxy?
source share