简体   繁体   中英

Including the standalone script is not working

I am simply including the script dropzone.js .

When doing this:

var dropZone = new Dropzone(..., {
  url: '...'
});

I get the following javascript error message:

Uncaught ReferenceError: Dropzone is not defined 

I have also requirejs coming from the platform we're running automatically but I don't want to use that. Could that have anything to do with it not working?

You can disable RequireJS for a single file by setting define.amd to false:

<script>
    window.oldDefineAmd = define.amd;
    define.amd = false;
</script>
<script src="dropzone.js"></script>
<script>define.amd = window.oldDefineAmd;</script>

http://jsfiddle.net/Pxp5L/5/

But note that this can break all kinds of stuff.

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