我试图从 ajax 调用中取回数据,并且正在使用代码
jQuery.ajax({
type: 'POST',
url: '/chatlog',
success: exoticlangAjaxCompleted,
data:'messageLog=' + privateMessageLogJson,
dataType: 'json'
});
数据在 JSON 数组中(key = "messageLog")
为什么打电话有用
success: exoticlangAjaxCompleted,
但不是
success: exoticlangAjaxCompleted(),
或者
success: exoticlangAjaxCompleted(messageLog) ??
JS函数是:
function exoticlangAjaxCompleted(messageLog){
console.log('exoticlangAjaxCompleted!');
console.log('chat log is: ' + messageLog);
console.log('chat log is: ' + dump(messageLog));
}