SCRIPT438:对象不支持IE中的属性或方法'push'

时间:2013-10-14 06:33:36

标签: javascript jquery ajax internet-explorer

您好我使用ajax实现了文件上传功能,我设置了ajax是同步类型   对于这种实现,我在我的ctp文件中使用了以下jQuery文件(我跟着    我的default.ctp中的cakePHP设计模式我使用了jquery 1.4)

 'jquery-1_7.js','jquery.form.js','jquery-ui_1_9_1.js'

并且每一件事在firefox中运行良好,来到IE它不能正常工作我的代码片段    如下

 var options = {
        complete: function(response) {
            var fileObj = jQuery.parseJSON(response.responseText);
            var fileId = fileObj.FileNo;
            var elemNo = fileId.replace('file', '');

                if(fileObj.Txt == 'SUCCESS'){
                   //copy the id into global; variable                      
            }
        },
        error: function(response) {
            //display error         
        }
    };

ajax call

  $('#sBtn').button().click(function(){
        $.ajaxSetup({async:false}); 
        files = []; //globalvaraiable                       
            for(i=0; i<fileCnt; i++){                       
                if ($('#addFile'+i).length > 0) {
                    $('#addFile'+i).ajaxForm(options);
                    $('#addFile'+i).submit();
                        window.setTimeout($('#addFile'+i).bind($('#addFile'+i)), 100);                      console.log(files);
                }
            }   

            $('#ContentId').ajaxForm($('input#contentIds').val(files));
            $('#ContentId').submit();
            $('#loadingImg').addClass('clear');                 
        }
        return false;
    });

在IE中我收到以下错误

  SCRIPT438: Object doesn't support property or method 'push' 
  jquery-1_7.js, line 3008 character 5

0 个答案:

没有答案
相关问题