You cannot load XML with jsonp, because data have to be written in json in a certain way.
Let's assume that your current data is something like that:
<address>
<fullname>John Doe</fullname>
<street>1st street</street>
<number>345</number>
<zip>12345</zip>
<city>Nowhere</city>
</address>
You'll have to send it in JSON, something like that:
{
fullname: "John Doe",
street: "1st street",
number: 345,
zip: "12345",
city: "Nowhere"
}
Moreover, if you need to receive it through JSONP, you'll need to make another modification. Let's say that you're sending your request like that:
$.ajax({
type: "GET",
url: "http://www.w3schools.com/json/note.js",
dataType: "jsonp",
success: function(data) {
alert('Hi');
}
});
When calling the web service, jQuery will add a parameter named callback
in the request URL.
Let's say the generated URL is: http://www.w3schools.com/json/note.js?callback=callback1234
Then, your json output will need to look like this:
callback1234({
fullname: "John Doe",
street: "1st street",
number: 345,
zip: "12345",
city: "Nowhere"
});