I was trying to get data back from an ajax call, and was using the code
jQuery.ajax({
type: 'POST',
url: '/chatlog',
success: exoticlangAjaxCompleted,
data:'messageLog=' + privateMessageLogJson,
dataType: 'json'
});
The data was in a JSON array (key = "messageLog")
Why did it work to call
success: exoticlangAjaxCompleted,
but not
success: exoticlangAjaxCompleted(),
or
success: exoticlangAjaxCompleted(messageLog) ??
JS function is:
function exoticlangAjaxCompleted(messageLog){
console.log('exoticlangAjaxCompleted!');
console.log('chat log is: ' + messageLog);
console.log('chat log is: ' + dump(messageLog));
}