$.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=UtVVPkx83hGZ2wKUKX1_0w&_render=json&_callback=?",
function(data) {
$.each(data.value.items, function(Id,item) {
$("<div/>").text(item.title).appendTo("#data");
});
});
$.getJSON("http://api.anywayanyday.com/api/NewRequest/?Route=2406MOWLON&AD=1&CN=0&CS=E&Partner=testapic&_Serialize=JSON&jsoncallback=?",
function(data) {
$.each(data.value.items, function(Id,item) {
$("<div/>").text(item.id).appendTo("#data2");
});
});
the first json works fine, but the one from anywayanyday doesnt, what can be the problem?
thank you all for the help!
Use
callbackinstead ofjsoncallback(what the callback’s argument is depends on the service you’re accessing). Also, it looks like the data looks something like this:And is not in a collection. The following code works for me:
Example: http://jsfiddle.net/WtxS3/