orpqK
orpqK

Reputation: 2795

JSONP works with XML?

I have this URL that is in XML: cdn.florianbussmann.de/stackoverflow/21140602_catalog.xml

I was using xmlHttprequest to work with this data in my javascript, but because of the same origin policy. I have to use JSONP. I found some examples, right now I have the following:

$.ajax({
        url:"http://cdn.florianbussmann.de/stackoverflow/21140602_catalog.xml",
        dataType: 'jsonp', 
        success:function(json){

            alert("Success");
        },
             error:function(){
                 alert("Error");
        },
    });

I always get an error, is it because I can not convert this XML page to JSONP?

Upvotes: 1

Views: 69

Answers (1)

Pointy
Pointy

Reputation: 413976

JSONP isn't something you can request from a site that is not prepared to respond properly. In other words, whoever is in control of the target site must provide a JSONP response API.

Upvotes: 2

Related Questions