2013-03-11 134 views
0

我有jQuery代码在Firefox,但不是在IE9正常工作的问题。在控制台我得到以下错误:绑定在Internet Explorer 9

SCRIPT5007: Unable to get the value of the property "bind" object null or undefined

这把我送到我的脚本的这一部分:

 //upload files 
    this.uploadFiles.bind('click', this, function(e){ 
     if(e.data.settings.enable) e.data.uploadAll(); 
     return false; 
    }); 

    //remove all files from list 
    this.removeFiles.bind('click', this, function(e){ 
     if(e.data.settings.enable) e.data.clearQueue(); 
     return false; 
    }); 

整个JS是此处下载 http://tinyurl.com/c9jl2x8(ajaxupload.js)

的脚本从 http://codecanyon.net/item/real-ajax-multi-uploader/805976

作者声称它应该适用于所有navigato rs ...但地狱它不是大声笑我做错了什么或什么?

我使用的脚本(jQuery的V1.7.2)来到我tryed使用1.9,同样的结果jQuery的文件。在我看来,代码的语法将需要改变,以便脚本正常工作,但我没有足够的jQuery知识来让它工作

+0

尝试使用'on'方法。 http://api.jquery.com/on – 2013-03-11 16:12:12

+0

都能跟得上,这是我所得到的 无法获取“的”属性的值:对空对象或undefined – 2013-03-11 16:16:36

+0

'()'采用不同的参数比'bind()的'。 – Christoph 2013-03-11 16:17:45

回答

0

该代码在库中定义了uploadFiles/removeFiles

//Upload all button 
this.uploadFiles = $('<a class="'+bs_upload+'" title="' + _('Upload all files') + '" />').append('<span class="'+bs_u_icon+'"></span> <span>' + _('Start upload') + '</span>').appendTo(this.fieldSet); 

//remove files button 
this.removeFiles = $('<a class="'+bs_remove+'" title="' + _('Remove all') + '" />').append('<span class="'+bs_r_icon+'"></span> <span>' + _('Remove all') + '</span>').appendTo(this.fieldSet); 

您必须解除它,所以它会停止抛出该错误

enter image description here

+0

THX在wirey加盟。不幸的是,这并没有解决问题http://tinyurl.com/c4wvlx3 – 2013-03-11 17:11:49

+0

@PatrickSimard我没有看到你所提供 – 2013-03-11 17:52:09

+0

是啊,我只是把它从URL中的document.ready函数中的代码。当我把它包装在$(function(){}); ajaxupload函数不会被重新调用 – 2013-03-11 18:25:32