Currently, I am faced with the challenge of extracting and processing data from the www.skiddle.com API using Javascript:
$.ajax({
url: 'http://www.skiddle.com/api/v1/events/search/?api_key=myapikey' + '&latitude=' + lat + '&longitude=' + long + '&radius=800&eventcode=LIVE&order=distance&description=1',
type: "GET",
success: function(response) {
var list = [];
$(response).find("results").each(function() {
var el = $(this);
var obj = {
"eventname": el.find("eventname").text(),
"imageurl" : el.find("imageurl").text(),
};
list.push(obj);
});
Upon examining the response, it appears to contain a results
property with a single element within an array:
{error: 0, totalcount: "1", pagecount: 1, results: Array(1)}
However, despite this structure, when attempting to parse it using $(response).find("results")
, no output is returned.