简体   繁体   English

包括独立脚本不起作用

[英]Including the standalone script is not working

I am simply including the script dropzone.js . 我只是包含了脚本dropzone.js

When doing this: 执行此操作时:

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

I get the following javascript error message: 我收到以下javascript错误消息:

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. 我也有requirejs来自我们正在自动运行的平台,但是我不想使用它。 Could that have anything to do with it not working? 可能与它无关吗?

You can disable RequireJS for a single file by setting define.amd to false: 您可以通过将define.amd设置为false来禁用单个文件的RequireJS:

<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/ http://jsfiddle.net/Pxp5L/5/

But note that this can break all kinds of stuff. 但是请注意,这可能会破坏所有东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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