Hi, i am trying to connect to a URL using httpclient in my app , and it printed the response to the console but to print it on TABLEROW VIEW is printed empty , view my code below :
var conn = Titanium.Network.createHTTPClient(); var url = 'http://127.0.0.1:8081/example/table.ashx?method=mobile='+ temp_num; Ti.API.info(url); conn.onload= function(e){ response = this.responseText;
var row = Ti.UI.createTableViewRow({
title:people[i].fullName,
desc:response,//temp_num,
leftImage:'topup1.png'
});
data.push(row);
alert("successful");
};//end of function onload ;
conn.DONE = function(e){
alert("REQUEST is DONE");
};
conn.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
conn.setRequestHeader("User-Agent",Titanium.userAgent);
conn.open("POST",url);
conn.send();