Note that there are some explanatory texts on larger screens.

plurals
  1. POParse json from bandsintown API
    primarykey
    data
    text
    <p>I have trouble to parse and show events from Bands in Town´s API in my appcelerator mobile app. (iOS) This is my bands event that i want to show in a table. <a href="http://api.bandsintown.com/artists/Lucy%20Seven/events.json?api_version=2.0&amp;app_id=LucySeven" rel="nofollow">http://api.bandsintown.com/artists/Lucy%20Seven/events.json?api_version=2.0&amp;app_id=LucySeven</a> And this is the code that i have for showing it</p> <pre><code>var win = Ti.UI.currentWindow; win.hideNavBar(); Ti.UI.backgroundColor = '#050505'; var url = "http://api.bandsintown.com/artists/Lucy%20Seven/events.json? api_version=2.0&amp;app_id=LucySeven" var table = Ti.UI.createTableView({ backgroundColor: '#050505', separatorColor:'#110000', }); var tableData = []; var json, artists, name, picture, title, description; var xhr = Ti.Network.createHTTPClient({ onload: function() { // Ti.API.debug(this.responseText); json = JSON.parse(this.responseText); for (i = 0; i &lt; json.data.length; i++) { data = json.data[i]; row = Ti.UI.createTableViewRow({ height:'100dp', backgroundColor: '#050505', separatorColor:'#110000', }); var name = Ti.UI.createLabel({ text: title, font:{ fontSize:'17dp', fontWeight:'bold' }, height:'auto', left:'90dp', top:'20dp', color:'#eee', touchEnabled:true }); row.add(name); var start = Ti.UI.createLabel({ text: description, font:{ fontSize:'12dp' }, height:'auto', left:'90dp', bottom:'20dp', color:'#eee', touchEnabled:true }); row.add(start); // Avatar var img = Ti.UI.createImageView({ image : thumb_url , width : 70, height : 70, top : 5, bottom : 5, borderRadius: 5, borderColor: '#eee', left : 5 }); row.add(img); tableData.push(row); } table.setData(tableData); }, onerror: function(e) { Ti.API.debug("STATUS: " + this.status); Ti.API.debug("TEXT: " + this.responseText); Ti.API.debug("ERROR: " + e.error); alert('There was an error retrieving the remote data. Try again.'); }, timeout:5000 }); xhr.open("GET", url); xhr.send(); </code></pre> <p>There is a API responses for json here: <a href="http://www.bandsintown.com/api/responses#events-json" rel="nofollow">http://www.bandsintown.com/api/responses#events-json</a> I really cant see what is wrong... Maybe im to blind to see what i have missed? I would appreciate if someone could point me in the right direction on this. i have tried with: data.title data.artists.title title artists.titel and so on but nothing have shown up in my tableview..... Thanx //R</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload