我在应运行 loginConnect.onload 的位置收到未知错误。
我正在遵循位于 http://code.tutsplus.com/tutorials/titanium-user-authentication-part-1--mobile-3728 的旧教程
如有任何帮助,我们将不胜感激!谢谢!
var loginConnect = Titanium.Network.createHTTPClient();
function gridWindow(e){
if($.username.value != ""&&$.password.value != ""){
loginConnect.open("POST","http://localhost:80/grid/indexgrid.php");
var params = {
username: $.username.value,
password: Ti.Utils.md5HexDigest($.password.value)
};
loginConnect.send(params);
} else{
alert('All fields are required');
}
};
loginConnect.onload = function()
{
var json = this.responseText;
var response = JSON.parse(json);
if (response.logged == true)
{
alert("Welcome back");
} else {
alert('not working');
}
};
$.index.open();
最佳答案
试试这个...
loginConnect.send(JSON.stringify(params));
关于javascript - 使用webapp开发钛json未知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23644229/