jsonp - jQuery feed processing -


we trying consume feed web site. have tried different approaches none of them working:

approach 1: trying content , parse manually

$.get("http://www.wwe.com/feeds/sapphire/news/all/all/0,1", {}, function(data){   alert(data);  }); 

we empty response. if paste url in browser window valid response (http://www.wwe.com/feeds/sapphire/news/all/all/0,1)

approach 2: using jsonp

we have code:

$.ajax({     url: "http://www.wwe.com/feeds/sapphire/news/all/all/0,1",     datatype: 'jsonp',     data: {},     error: function (jqxhr, textstatus,errorthrown) {         console.log("error");     },     contenttype: "application/json",     success: function (data, textstatus, jqxhr) {         console.log('success_function');         console.log(data);     } }); 

server responding invalid label. seems in response callback function missing. appreciated.

it appears service attempting load doesn't support jsonp. without can't straight jquery ajax call across domains.

see: json cross site without jsonp

you can test keeping code same , testing url support jsonp (e.g. https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=espn&count=1)

the alternative appears create proxy on sever pass data through javascript.


Comments