37
rated 0 times
[
41]
[
4]
/ answers: 1 / hits: 61654
/ 9 Years ago, mon, november 16, 2015, 12:00:00
I have used dropzone.js (http://www.dropzonejs.com/). I am trying to add delete button to delete the image. but i am getting javascript undefined error
<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>
More From » php