我正在使用Uploadify 3.1,並且在單擊上傳按鈕時出現錯誤「未捕獲的TypeError:無法讀取未定義的屬性'queueData'」。以下是我的代碼。不確定是什麼問題。uploadify queueData錯誤
上傳領域:
<input type="file" name="file_upload" id="file_upload"/>
<input type="button" class="batchImport" value="Upload Files"/>
的Javascript:
$(document).on("click",".batchImportElements",function(){
$("#objectDetails").hide().html("");
$("#objectList").show();
$("#objectList").html("<img src="images/loading.gif"/> Loading").show();
$.ajax({
type:"POST",
data:{
multiple:1
},
url:"/index.php/elements_handler/importElements",
success:function(response){
checkResponse(response);
$("#objectList").html(response);
$("#file_upload").uploadify({
"swf":"/js/uploadify-v3.1/uploadify.swf",
"uploader":"/js/uploadify-v3.1/uploadify.php",
"uploadFolder":"/uploads/",
"auto":false,
"multi":true,
"height":19,
"width":94,
"onUploadError":function(file,errorCode,errorMsg,errorString){
alert("The file " + file.name + " could not be uploaded: " + errorString);
},
"onUploadSuccess":function(file, data, response){
$.ajax({
type:"POST",
data:{
multiple:1,
companies_id:companies_id,
file:file,
data:data,
folderPath:1
},
url:"/index.php/elements_handler/importElements",
success:function(response){
checkResponse(response);
}
});
}
});
$(document).on("click",".batchImport",function(){
$(".batchImport").uploadify("upload");
});
}
});
});
`
的$('.batchImport')
是用來觸發上傳按鈕。任何幫助,將不勝感激。
batchImport如何獲得文件控件,因爲在粘貼的代碼中它沒有它? – 2012-07-25 12:25:35
我現在也添加了它,以便您可以看到它。 – user1013129 2012-07-25 12:29:06