admin管理员组文章数量:1431461
i need to refresh the iframe after upload ajax about 2 seconds after it shows loading div but i can't set timeout for ajaxstop function
is there any way to do this?
$('form').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = '0%';
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
$("#progressbar").progressbar({
value: percentComplete
});
$('#porcentagem').html(percentVal);
if(percentComplete == 100){
$('#wait').remove();
}
},
plete: function() {
setTimeout(function(){
$('#conteudo_upload').hide();
$('#loading').show();
}, 800);
setTimeout(function(){
$(document).ajaxStop(function(){
window.location.reload();
});
}, 1000);
}
});
i need to refresh the iframe after upload ajax about 2 seconds after it shows loading div but i can't set timeout for ajaxstop function
is there any way to do this?
$('form').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = '0%';
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
$("#progressbar").progressbar({
value: percentComplete
});
$('#porcentagem').html(percentVal);
if(percentComplete == 100){
$('#wait').remove();
}
},
plete: function() {
setTimeout(function(){
$('#conteudo_upload').hide();
$('#loading').show();
}, 800);
setTimeout(function(){
$(document).ajaxStop(function(){
window.location.reload();
});
}, 1000);
}
});
Share
Improve this question
asked Jul 23, 2013 at 6:35
Eddie D.Eddie D.
1453 silver badges12 bronze badges
2 Answers
Reset to default 2If you want to wait 1 second after all AJAX events plete, then you should change
setTimeout(function(){
$(document).ajaxStop(function(){
window.location.reload();
});
}, 1000);
to
$(document).ajaxStop(function(){
setTimeout(function(){
window.location.reload();
}, 1000);
});
try this:
$('form').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = '0%';
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
$("#progressbar").progressbar({
value: percentComplete
});
$('#porcentagem').html(percentVal);
if(percentComplete == 100){
$('#wait').remove();
}
},
plete: function() {
setTimeout(function(){
$('#conteudo_upload').hide();
$('#loading').show();
}, 800);
setTimeout(function(){
window.location.reload();
}, 1000);
}
});
本文标签: javascriptrefresh page after ajaxStack Overflow
版权声明:本文标题:javascript - refresh page after ajax - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745576209a2664342.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论