options的回掉函数参数怎么传递?
有点不太明白beforeSubmit跟success的回掉函数是如何获取参数信息的,有人能跟我说下这个过程么
function singleDel(itemId) {
var delChkUrl = $("#delCheckAction").val();
var options = {
beforeSubmit: showDeleteCheckRequest,
success: showDeleteCheckResponse,
type: 'post',
dataType: "script",
data:{
'itemId':itemId
},
url: delChkUrl
};
$('#form1').ajaxSubmit(options);
}
function showDeleteCheckRequest(formData, jqForm, options) {
return true;
}
function showDeleteCheckResponse(responseText, statusText, xhr, $form) {
responseText = $.parseJSON(responseText);
var status = responseText[0].deleteAble;
if (status == "true") {
var itemId = responseText[0].itemId;
var delUrl = $("#delAction").val();
tipShow('#confirmDiv');
objDelUrl = delUrl;
objItemId = itemId;
} else if (status == "false") {
alert(responseText[0]._mes);
} else {
alert("删除失败!");
}