I am completely new to JavaScript and it drives me crazy.
I want to use Dropzone.js, so I downloaded the dropzone.js file from here and included it in my view as follows:
<script src="<?php echo JS_DIRECTORY; ?>/dropzone.js"></script>
Then I created this form:
<form action="http://localhost/project/uploadTest/upload" class="dropzone">
</form>
And it works great. This points to the php function, and I am uploading to the server site.
The problem is when I want to access the dropzone object in JS in order to configure it. When i do
Dropzone.options.myAwesomeDropzone = {
paramName: "file",
maxFilesize: 2,
accept: function(file, done) {
if (file.name == "justinbieber.jpg") {
done("Naha, you don't.");
}
else { done(); }
}
};
I got
Uncaught ReferenceError: Dropzone undefined
Any help would be appreciated, thanks
zachu source
share