Dropzone no url provided / Dropzone already attached

杀马特。学长 韩版系。学妹 提交于 2021-02-20 06:41:51

问题


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


回答1:


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

});`


来源:https://stackoverflow.com/questions/42227643/dropzone-no-url-provided-dropzone-already-attached

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!