Skip to content

Instantly share code, notes, and snippets.

@bob-sims
Last active December 12, 2015 09:19
Show Gist options
  • Save bob-sims/4750915 to your computer and use it in GitHub Desktop.
Save bob-sims/4750915 to your computer and use it in GitHub Desktop.
// demo to parse JSON feed
// response to https://twitter.com/Saucerdk/status/300691053743316992
// https://twitter.com/Saucerdk/status/300690859253448704
var xhr = Ti.Network.createHTTPClient();
xhr.open('GET','http://www.achorsens.dk/custom_api.php?format=json&type=spillere');
xhr.send();
xhr.onload = function(){
var response = JSON.parse(xhr.responseText);
for (var i in response.data) {
Ti.API.info(response.data[i].name);
Ti.API.info(JSON.stringify(response.data[i]));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment