weekapaug
asked on
Trying to redirect after event in javascript
I'm using dropzone, a multi-file uploader.
Read through the documents that says there is a queuecomplete special event.
I found this information:
Special Events: Queuecomplete and this code to go with it
<script src="./path/to/dropzone.js "></script >
<script>
Dropzone.options.filedrop = {
init: function () {
this.on("queuecomplete", function (file) {
alert("All files have uploaded ");
});
}
};
</script>
I put the above code on the page that has the form to submit and was expecting to see this alert go off when it was done but nothing happens. So first off I need to figure out if I'm putting it in the right spot, or why it doesnt work. And once I can get this to work, I need to redirect to a page rather than just setting off a popup window.
Thanks, I'm new to javascript and feel like I'm missing something very basic. I did change the directory of the script and everything else works fine with the uploads its only the queuecomplete event I can't seem to hook in with.
Read through the documents that says there is a queuecomplete special event.
I found this information:
Special Events: Queuecomplete and this code to go with it
<script src="./path/to/dropzone.js
<script>
Dropzone.options.filedrop = {
init: function () {
this.on("queuecomplete", function (file) {
alert("All files have uploaded ");
});
}
};
</script>
I put the above code on the page that has the form to submit and was expecting to see this alert go off when it was done but nothing happens. So first off I need to figure out if I'm putting it in the right spot, or why it doesnt work. And once I can get this to work, I need to redirect to a page rather than just setting off a popup window.
Thanks, I'm new to javascript and feel like I'm missing something very basic. I did change the directory of the script and everything else works fine with the uploads its only the queuecomplete event I can't seem to hook in with.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this.on("queuecomplete", function (file) {
window.location = "http://somewhere.interesting.and.useful.com";
});
ASKER
Could you tell me what the code is to redirect instead of alert?