I am using the DataTables plugin and the colorbox plugin. I am trying to have my function return true if the .post is a success.
jQuery('.msg_delete').live('click', function () {
var aData = oTable.fnGetData(nTr);
if (deleteMessage(aData[6]) == true) {
jQuery.colorbox.close();
oTable.fnDeleteRow(nTr);
}
return false;
});
function deleteMessage(messageID) {
jQuery.post('ajax/msg_functions.asp', { action: 'delete', messageid: messageID }, function (data) {
})
.success(function () { return true; })
.error(function () { alert("There was an error while trying to make this request; If it persists please contact support"); })
;
}
Right now it correctly does the post. I know this because the message is deleted. So I assume it goes to the .success
and I would think would now return true. But it doesn't seem to be doing that.
It never seems to go to the colorbox.close()
or fnDeleteRow.
Can anyone see what I am missing here?