jQuery表单插件 - 文件上传时未捕获的TypeError

oca*_*nal 4 jquery file-upload jquery-forms-plugin

当我没有选择任何文件进行上传时,没有问题,当我只填写其他输入而不是帖子形式时,它正在工作.但是当我选择一个文件进行图片上传而不是发布时,我收到了这个错误,但是当我查看文件夹时,我看到该文件已上传.但是javascript失败了.

jquery.form.js:357 Uncaught TypeError: 
Object function (a,b){return new d.fn.init(a,b,g)} has no method 'handleError'
Run Code Online (Sandbox Code Playgroud)

这是我的代码,

<form id="employeeaddform" class = "classform" enctype="multipart/form-data" action="inc/employeeadd.php"  method="post">
        <p><input type="file" size="32" name="my_field" value="" /></p>
        <p class="button"><input type="hidden" name="action" value="image" />

        <label for="nname">Personal Name : </label> 
        <input name="nname" id="nname" type="text" tabindex="11" />
        <br />

        <label for="ninformation">Information : </label>
        <textarea id="ninformation" name="ninformation"></textarea>

        <div align="center">
            <input id="button1" type="submit"/> 
            <input id="button2" type="reset" />
        </div>
</form>

<script type="text/javascript">
$(document).ready(function(){
        var options_employeeadd = { 
                beforeSubmit:  validate_employeeadd,  // pre-submit callback 
                success:       showResponse_employeeadd  // post-submit callback 
                                   };

        $('#employeeaddform').ajaxForm(options_employeeadd); });

        function validate_employeeadd(formData, jqForm, options) {...}

        function showResponse_employeeadd(responseText, statusText, xhr, $form)  {...} 
Run Code Online (Sandbox Code Playgroud)

小智 7

最新版本的jquery表单不使用'handelError'.在这里下载:https://github.com/malsup/form/blob/master/jquery.form.js