[英]jQuery Upload File Plugin - how to reload page after upload?
I am using this plugin: http://hayageek.com/docs/jquery-upload-file.php on my site.我正在使用这个插件: http : //hayageek.com/docs/jquery-upload-file.php在我的网站上。
It is working nice, but I need to reload page after successful upload.它运行良好,但我需要在成功上传后重新加载页面。 There is some Callback afterUploadAll which maybe can do it, but I don´t know how to implement it.有一些回调 afterUploadAll 也许可以做到,但我不知道如何实现它。
Here is my code, how can I add it to that?:这是我的代码,如何将其添加到其中?:
<h1>Header</h1>
<div class="wrapper">
<div id="uploader">Upload</div>
</div>
<script>
$(document).ready(function()
{
$("#uploader").uploadFile({
url:"upload.php",
fileName:"myfile",
showDone:true,
maxFileSize: 20971520,
showFileCounter: false,
});
</script>
<script>
$(document).ready(function()
{
$("#uploader").uploadFile({
url:"upload.php",
fileName:"myfile",
showDone:true,
maxFileSize: 20971520,
showFileCounter: false,
afterUploadAll: function(obj) {
window.location = 'YOUR URL HERE';
}
});
OR或者
<script>
$(document).ready(function()
{
$("#uploader").uploadFile({
url:"upload.php",
fileName:"myfile",
showDone:true,
maxFileSize: 20971520,
showFileCounter: false,
afterUploadAll: function(obj) {
location.reload();
}
});
try:尝试:
<script>
$(document).ready(function()
{
$("#uploader").uploadFile({
url:"upload.php",
fileName:"myfile",
showDone:true,
maxFileSize: 20971520,
showFileCounter: false,
afterUploadAll: function(obj) {
window.location = 'http://www.example.de';
}
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.