2012-07-23 80 views
1

我在ASPX下面的代碼JQuery的多文件事件不觸發

<input id="fileControl" type="file" class="multi" name="fileControl"/> 

$(document).ready(function() { 
     var fileSelections = []; 
     $('#fileControl').MultiFile({ 

      onFileAppend: function() { 
       //$('#F9-Log').append('<li>onFileAppend - '+value+'</li>') 

       fileSelections.push(value); 
      }, 
      onFileSelect: function() { 

       fileSelections.push(); 
      }, 
      afterFileSelect: function() { 

       fileSelections.push(); 
      }, 
      afterFileAppend: function() { 

       fileSelections.push(); 
      } 

     }); 

    }); 

我已經添加了以下文件作爲jQuery的多文件插件的一部分

jquery.MetaData.js 
jquery.MultiFile.js 
jquery.MultiFile.pack.js 

但是當我添加或刪除文件時,事件不會被觸發。爲什麼是這樣?

回答

1

我遇到了同樣的問題,問題是如果你想訂閱事件,你不能在輸入元素中設置類。

所以,你的輸入元素應該是這樣的: <input id="fileControl" type="file" name="fileControl"/>

那麼它應該工作。

我想這不再是你的問題,但如果這是其他人需要的情況。