我有一个使用dropzone.js的jQuery多个拖放文件上传器。
我已将以下代码添加到dropzone代码中
this.on("queuecomplete", function (file) {
alert("&success=yes");
});
因此,当队列完成时,它会在此时发送警报,但是我想更改它,以便使用jquery将其添加为URL的参数。
任何想法如何使用jquery做到这一点?
这将完成工作...
this.on("queuecomplete", function (file) {
var url = document.location.href+"&success=yes";
document.location = url;
});
选项二(如果您已经有一个参数)
this.on("queuecomplete", function (file) {
if(document.location.href.contains('?')) {
var url = document.location.href+"&success=yes";
}else{
var url = document.location.href+"?success=yes";
}
document.location = url;
});