0
這是從後期獲取的數據是一個簡單的對象,並且返回值始終爲空。它的日誌記錄到控制檯很好。有任何想法嗎?javascript函數沒有返回值,但會寫入console.log
function getTaskData(item){
var returnText = '';
$.post("index.php", {name: "getTaskData", pk: item.taskDataId}, function(data){
console.log(data);///Object {taskData: "Also - whats up with this?"}
console.log(data.taskData);///Also - whats up with this?
returnText = data.taskData;
},"json");
return returnText;
}
在這裏看到我的回答:http://pastebin.com/fVqTdvVr – floww