jQuery Form API没有在ajaxSubmit上执行Success Callback

时间:2015-01-31 11:32:10

标签: javascript jquery ajaxsubmit

这是我成功的回调函数,但它没有执行:

function onComplete (responseText) {

    alert(responseText);
    $('#progressText').remove();
    $('#uploadImg').show();

}

这是我的主要代码..

var options = {
        target:   '#output',   // target element(s) to be updated with server response
        beforeSubmit:  beforeSubmit,  // pre-submit callback
        uploadProgress: OnProgress,
        success: onComplete,
        resetForm: true        // reset the form after successful submit
    };

    $(document).on('submit', '#MyUploadForm', function() {
        $(this).ajaxSubmit(options);  //Ajax Submit form
        // return false to prevent standard browser submit and page navigation
        return false;
    });

除了成功之外,每个其他回调都会执行.. 在我的PHP代码中也成功地将数据保存在db中我已经设置了

http_response_code(200);

0 个答案:

没有答案