我从事 iphone 应用程序开发。我创建了一个 sampleTest 按钮,每当我单击它时,都会调用以下函数。但无法返回任何回应。它显示空警报消息。(hostName 和 portNo 是动态输入)
sampleTestBtn.addEventListener('click', function()
{
var regDetails = '{"user_login": {"email": "sample@sample.com", "password": "password"}}';
var client = Titanium.Network.createHTTPClient({timeout: 10000});
client.cache = false;
client.open("POST", "http://"+hostName+":"+portNo+"/AccountCreate");
client.setRequestHeader("Content-Type", "application/json");
client.send(regDetails);
alert(JSON.parse(this.responseText));
});
can any one please.