I want to request a remote XML file. I have read JSONP is the only way to do this without writing server side code. I am trying to request an XML file using the following code
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.ajax({
url: 'http://www.w3schools.com/xml/note.xml',
dataType: 'jsonp',
success: function(dataWeGotViaJsonp){
console.log(dataWeGotViaJsonp);
}
});
})
</script>
</head>
<body>
</body>
</html>
I get the error:
Resource interpreted as Script but transferred with MIME type text/xml: "http://www.w3schools.com/xml/note.xml?callback=jQuery1620008313672617077827_1390902958529&_=1390902958534". jquery.min.js:18 Uncaught SyntaxError: Unexpected token <
Any help much appreciated.