I have this code, and have also tried something similar using the $.getJson function:
jQuery(document).ready(function(){
var kiva_url = "http://api.kivaws.org/v1/loans/newest.json";
jQuery.ajax({
type: "GET",
url: kiva_url,
data:"format=json",
success: function(data){
alert("here");
jQuery.each(data.loans, function(i, loan){
jQuery("#inner_div").append(loan.name + "<br />");
});
},
dataType: "jsonp",
error: function(){
alert("error");
}
});
});
When I look in Firebug it is returning an "invalid label" error. I've searched around a bit some people refer to using a parser to parse the results. I can see the results coming back in Firebug. Can someone point to an example of what I should be doing?
The Firebug error:
invalid label =1249440194924&format=json&">http://api.kivaws.org/v1/loans/newest.json?callback=jsonp1249440194660&=1249440194924&format=json& Line 1
Sample output of what the json looks like can be found here: http://build.kiva.org/docs/data/loans