我的函数返回undefined,我不确定如何找到我正在查找的数据。
function getCustomerName(){
var account = localStorage.getItem("account");
$.post("http://127.0.0.1/getCustomer.php", {account:account}, function(data) {
alert('Inside getCustomer' + ' ' + data);
} ,"json");
}
而getCustomer.php返回
{"nameCustomer":[{"Alarms":"0","Name":"Jane Doe"}]}
任何帮助,将不胜感激。
欢迎** **异步的奇妙世界!你需要使用回调。 – SLaks
你能指点我一个这样的例子吗? – user1668630
我已经使用回调之前的jsonp,但我不确定如何发布/获取使用它? – user1668630