Compatible with dropzone.js and jQuery

I recently used dropzone.js in some projects and set up the parameters without problems, but in the new project I used the latest version of jQuery (3.1.0), automatically installed by Zend Framework 3, and appears to cause some kind of conflict with dropzone.js version 4.3.0.

I was not able to configure the settings for my dropzone, it always uses the default settings.

+3
javascript jquery
source share
3 answers

If anyone else needs to use Dropzone with jQuery 3, especially if you need to reference jQuery methods in Dropzone callbacks, this worked for me:

// Do this outside of jQuery Dropzone.autoDiscover = false; // Start jQuery stuff $(function() { // Call Dropzone manually $("#dropzone").dropzone({ paramName: "image", maxFilesize: 8, // MB queuecomplete: function() { // Some more jQuery stuff inside Dropzone callback $("#some_id").somejQueryMethod(); } }); }); 
+2
source share

My solution, of course, was to revert to an older version of jQuery, which is enough for me (1.11.1).

Hope this helps, and if anyone knows the cause of the conflict, it's cool!

Hi

0
source share

Afer half an hour of searching, I found a problem; it works if forfor is declared

 $(document).ready(function () {}); 

or

 $(function () {...}); 

beacuse dropzone initiate use of jquery load methods

0
source share

All Articles