Getting error when trying to return value using dropzone

117 Views Asked by At

hi i want to recover id use dropzone but it gives me error Uncaught SyntaxError: Unexpected token '.' i don't know why.

 var id = $("#id").html();
            Dropzone.options.dropzone = function(){console.log(id)};
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/min/dropzone.min.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/dropzone.js"></script>
<h3 class="jumbotron" id="id">241</h3>

1

There are 1 best solutions below

0
On

I don't the package but you have a syntax error here.

If Dropzone.options.dropzone suppose to be an object you should pass it with a set of key and values like this:

Dropzone.options.dropzone = 
 {
  key: "value";
 }

Or if it supposes to get a function do it like this:

Dropzone.options.dropzone = function(){console.log(id)};

Does one of these solutions solves your problem?