I have a page that fetches an ajax response. That response
- includes another ajax response
- the last response has a dropzone which is initialised with the following
$(document).ready(function() {
$("#uploadme").dropzone({
paramName: 'photos',
url: 'upload.php',
dictDefaultMessage: "drop here",
clickable: true,
enqueueForUpload: true,
maxFilesize: 1,
uploadMultiple: false,
addRemoveLinks: true
});
});
That works well the first time.
The second response (2.) reloads itself when posting in a form. When this happens, I get this error in the console
Uncaught TypeError: $(...).dropzone is not a function
I guess (and I'm purely guessing now) that dropzone is called upon to soon, but how do I solve this?