var test;
$.post("query.php",{id:id})
.done(function(data){
test = $.parseJSON(data);});
console.log(test);
data是有撈出資料的
但是test一直顯示是undefined
這個問題是什麼呢!?
data內容:
[{"0":"120.95","rest_lon":"120.95","1":"24.8","rest_lat":"24.8",
"2":"\u65b0\u7af9\u5e02\u5927\u5b78\u8def1001\u865f",
"rest_address":"\u65b0\u7af9\u5e02\u5927\u5b78\u8def1001\u865f",
"3":"03-3369880","rest_tel":"03-3369880"},
{"0":"120.96","rest_lon":"120.96","1":"24.81","rest_lat":"24.81",
"2":"\u65b0\u7af9\u7e23\u5927\u5b78\u8def1\u865f",
"rest_address":"\u65b0\u7af9\u7e23\u5927\u5b78\u8def1\u865f",
"3":"03-2571864","rest_tel":"03-2571864"}]