[jQuery] ajaxSuccess function is not run
I use jquery.form plugin to submit a form , but the ajaxSuccess()
function not run, other function run exacitly , how can i let jquery
knows it run success
Codes:
function submitImageUploadForm(){
// 显示 loading 图片
$("#loading")
.ajaxStart(function(){
$(this).show();
})
.ajaxComplete(function(){
$(this).hide();
});
// 即时消息提示
$('#upload_error')
.ajaxStart(function(){
$(this).text("请稍等,照片正在上传中...");
})
.ajaxComplete(function(){
$(this).text("上传完毕...");
})
.ajaxSuccess(function(){
$(this).text('上传成功,进行下一步');
});
var options ={
// URL 在 form 表单中定义,这里定义不妥
dataType: 'json',
resetForm: true,
//success: function(data) {
// 成功后去掉上传框中内容,避免重复上传,同时去掉提示
// $('#fileupload').val('');
// 成功后让按钮不能点击,以进行下一步
// $('#upload_error').text('上传成功,进行下一步');
// json data
// alert("fffffffff");
//}
};
$('#uploadform').ajaxSubmit(options);
}