Ho usato dropzone.js (http://www.dropzonejs.com/). Sto cercando di aggiungere il pulsante Elimina per eliminare l'immagine. ma sto ottenendo javascript errore non definitocome aggiungere l'opzione removefile nel plugin dropzone?
<script>
Dropzone.options.myDropzone = {
init: function() {
addRemoveLinks: true,
thisDropzone = this;
$.get('photo-add.php', function(data) {
$.each(data, function(key,value){
var mockFile = { name: value.name, size: value.size };
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "upload/"+value.name);
});
});
this.on("removedfile", function(file) {
alert(file.name);
console.log(file);
// Create the remove button
var removeButton = Dropzone.createElement("<button>Remove file</button>");
//Capture the Dropzone instance as closure.
var _this = this;
// Listen to the click event
removeButton.addEventListener();
// Add the button to the file preview element.
file.previewElement.appendChild(removeButton);
});
}
};
</script>
come aggiungere il link php url per eliminare il file? –
potresti inviarmi il codice completo –
Hi raju sto ancora ricevendo il removelink undefined –