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);
}
});