Is there a way to refresh page after setTimeout()
function call is executed?
here is the code of setTimeout function call:
setTimeout(function(){
$('#alert-success').slideUp('slow').fadeOut();
}, 5000);
try with
setTimeout(function(){
$('#alert-success').slideUp('slow').fadeOut(function() {
window.location.reload();
/* or window.location = window.location.href; */
});
}, 5000);
You could do like this:
(when you use .slideUp
, there is no need to use .fadeOut
)
setTimeout(function() {
$('#alert-success').slideUp('slow', window.location.reload);
}, 5000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With