问题
Hi can you help me to make a solution about my problem?
This is my code:
$(document).ready(function() {
$('#sample').load('sample.html')
});
after the script execute and the sample.html is now loaded where my...
<form action="upload.php" class="dropzone"></form>
is located the dropzone js is not working.
Please help me about this issue . I can't figured how to make a solution for this.
Thanks!
回答1:
You need to tell dropzone to reparse the document. If you using jquery.load method Also only use Dropzone.discover method after uploader is fully loaded.
$('#sample').load('sample.html', function() {
Dropzone.discover();
});
回答2:
you need to use the $.getScript method to load the JS file.. getScript
$.getScript("yourJsPath", function(data, textStatus, jqxhr) {
console.log(data); //data returned
console.log(textStatus); //success
console.log(jqxhr.status); //200
console.log('Load was performed.');
});
来源:https://stackoverflow.com/questions/17986496/the-dropzone-is-not-working-after-jquery-load-execute