我正在使用 Uploadify 3.1 并在单击上传按钮时收到错误“未捕获的类型错误:无法读取未定义的属性 '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')
是用于触发上传的按钮。任何帮助,将不胜感激。