简体   繁体   中英

Dropzone no url provided / Dropzone already attached

I feel like I am loosing my mind here. I have read all the threads relating to my issue, I have added the "Dropzone.autoDiscover = false;" but nothing seems to work.

I keep getting :

Uncaught Error: No URL provided. & Uncaught Error: Dropzone already attached.

I made a basic setup to its simplest form but still does not want to work.

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Dropzone</title>
    <link rel="stylesheet" href="css/main.min.css">
    </head>
    <body><div class="modal">
    <div class="modal-dialog">
    <div class="modal-header">

    </div>
    <div class="modal-body">

      <div class="modal-body__inner">

          <form action="some-url.php" >
              <div class="formfield"><label for="name">Name:</label><input type="text" name="" value=""></div>
              <div class="formfield"><label for="name">Email:</label><input type="text" name="" value=""></div>
              <div class="formfield"><label for="name">Number:</label><input type="text" name="" value=""></div>
              <div class="formfield"><div id="my-dropzone" class="dropzone"></div></div>
          </form>
      </div>

    </div>
  </div>
</div>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/dropzone.js"></script>
<script src="js/script.js"></script>

added script:

      $(document).ready(function(){
      //Dropzone Configuration
      Dropzone.autoDiscover = false;

      $('#my-dropzone').dropzone({
        url: 'post.php',
         method: 'post'
        });
      });

Not sure what i am doing wrong, this is suppose to be a simple plug and configure

Do you try to put autoDiscover option before $(document).ready? That did the trick on my side.

//Dropzone Configuration
Dropzone.autoDiscover = false;

$(document).ready(function(){

  $('#my-dropzone').dropzone({
    url: 'post.php',
    method: 'post'
  });

});`

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