dropzone.js is giving error "Invalid dropzone element" on page without a dropzone
With pure JS you can try this:
if (document.getElementById('DropzoneElementId')) {
var myDropzone = new Dropzone("div#DropzoneElementId", { url: "/file/post"});
// other code here
}
or if you use jQuery:
if ($('#DropzoneElementId').length) {
$("div#DropzoneElementId").dropzone({ url: "/file/post" });
// other code here
}