2013-03-11 137 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