我的函數返回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