gpt4 book ai didi

javascript - 拖放区 : "No URL provided" and "Dropzone already attached."

转载 作者:行者123 更新时间:2023-11-30 09:25:28 32 4
gpt4 key购买 nike

我正在使用 dropzone 和 jquery。我有这段代码:

  <div id="my-image">
<!-- .......... -->
</div>

  <script type="text/javascript">
Dropzone.autoDiscover = false;

$(document).ready(function() {
var image_uploader = new Dropzone("#upload-image", {url: "/image_uploader", acceptedFiles : "image/*",
maxFiles: 1, maxFilesize: 1, autoDiscover: false});

//.................

但是我有这两个错误:

//dropzone.js:712
Uncaught Error: No URL provided.
at new Dropzone (dropzone.js:712)
at Function.Dropzone.discover (dropzone.js:1641)
at Dropzone._autoDiscoverFunction (dropzone.js:1923)
at HTMLDocument.init (dropzone.js:1892)

和:

//jquery-3.3.1.min.js:2

Uncaught Error: Dropzone already attached.
at new Dropzone (dropzone.js:699)
at HTMLDocument.<anonymous> ((index):221)
at l (jquery-3.3.1.min.js:2)
at c (jquery-3.3.1.min.js:2)

它们为什么会出现?如何修复它们?

最佳答案

对于第一个错误,您必须在 $(document).ready(function (){}) 之前添加 Dropzone.autoDiscover = false;

对于第二个错误,我认为您声明了 Dropzopne.js 两次。

关于javascript - 拖放区 : "No URL provided" and "Dropzone already attached.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49290232/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com