1
Я использую плагин dropzonejs.com. Теперь я пишу в HTML документе Этот кодКак поймать события плагина dropzonejs
<form action="<?php print $this->link('task', 'upload'); ?>" id="pinupload" class="dropzone" style="width:450px;">
</form>
, и это работает прекрасно. Но мне нужны события catch dropzone: когда файл загружается, когда вы начинаете загрузку для подтверждения.
Я написал этот код:
Dropzone.options.myDropzone = {
init: function() {
this.on("addedfile", function(file) {
// Capture the Dropzone instance as closure.
var _this = this;
// Listen to the click event
removeButton.addEventListener("click", function(e) {
// Make sure the button click doesn't submit the form:
e.preventDefault();
e.stopPropagation();
// Remove the file preview.
_this.removeFile(file);
// If you want to the delete the file on the server as well,
// you can do the AJAX request here.
});
});
}
};
, но с этим кодом, я не могу отловить событие. Зачем ?