function addthumdropzone(){
var myDropzone = Dropzone("#myDropzone");
var myFile = {
name: "mypdf.pdf",
size: 987654321
};
myDropzone.emit("addedfile", myFile);
myDropzone.emit("thumbnail", myFile, "http://localhost/simas/data/uploads/26");
};
我的代码有什么问题?为什么我的Firefox显示错误
TypeError: this.defaultOptions is undefined
我的init,当document.ready时我打电话
function dropzoneinit(){
if(typeof Dropzone != 'undefined')
{
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#myDropzone", {
url: "engine/action/action.php",
maxFileSize: 50,
acceptedFiles: ".pdf",
addRemoveLinks: true
});
myDropzone.on("removedfile", function(file) {
iddata=document.getElementById("fkirimemailiddata").value;
$.ajax({
url: "engine/action/action.php",
type: "POST",
data: { 'what': 'deleteattacment','fkirimemailiddata' :iddata,'fkirimemailnmfile' :file.name}
});
});
}
};
最佳答案
确保在页面上包含dropzone.js。
看来您错过了“新”关键字。尝试这个:
var myDropzone = new Dropzone("#myDropzone");