【发布时间】:2011-09-28 20:34:29
【问题描述】:
我目前正在使用 Phonegap 和 XUI 来创建网络应用程序。
我正在通过 XUI 使用 http 请求从外部域检索一些数据。
这工作正常,我正确接收到 JSON 数据,请参阅下面的数据格式:
({"first":"John","last":"Smith","HighScore":"75"})
所以现在我希望能够使用 javascript 访问数据的各个资产。
x$('#test').xhr(URL,function() {
loggedin = this.responseText; // This is the data that has been received from the PHP file
if(loggedin != '1') // If not 1 then will let them in
{
alert(loggedin); // Alerts with the data recieved
}
else // Login incorrect
{alert('Sorry you login details were incorrect please try again.');}
});
我知道这可能很简单,但我似乎无法弄清楚,因此非常感谢任何帮助。
谢谢,
凯恩
【问题讨论】:
标签: php javascript ajax json xui