简体   繁体   中英

$(…).dropzone is not a function when using dropzone with browserify

I would like to know how to use dropzone with browserify. I use it in the most naive way but in vain.

var dropzone = require('dropzone');
var $ = require('jquery');

$('div#form').dropzone({ url: '/form' });

I ve got a warning saying $(...).dropzone is not a function.

Can anyone point me a way out?

Brian

try this one:

 var jQuery = require('jquery'); var dropzone = require('dropzone'); jQuery('div#form').dropzone({ url: '/form' }); 

Dropzone script check the type of jQuery, so you should define jQuery(but not $) and firstly you should difine jQuery and just after it Dropzone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM