admin管理员组

文章数量:1325359

I'm using dropzone and jquery. I have this code:

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

And

  <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});

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

And yet I have these 2 errors:

//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)

And:

//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)

Why are they occuring? How to fix them?

I'm using dropzone and jquery. I have this code:

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

And

  <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});

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

And yet I have these 2 errors:

//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)

And:

//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)

Why are they occuring? How to fix them?

Share Improve this question asked Mar 15, 2018 at 1:36 MarekaMareka 191 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

For the first error you have to add Dropzone.autoDiscover = false; before $(document).ready(function (){})

For the second error I think you are declaring Dropzopne.js twice.

本文标签: javascriptDropZone quotNo URL providedquot and quotDropzone already attachedquotStack Overflow