2012-08-29 9 views

Respuesta

21

intento con

setTimeout(function(){ 
    $('#alert-success').slideUp('slow').fadeOut(function() { 
     window.location.reload(); 
     /* or window.location = window.location.href; */ 
    }); 
}, 5000); 
+0

estaba editando, pero me golpearon :) – Flash

+0

Gracias por tonelada para una respuesta rápida, Fabricio ahora está resuelto. – Arish

2

Se podría hacer como esto: (cuando se utiliza .slideUp, no hay necesidad de usar .fadeOut)

setTimeout(function() { 
    $('#alert-success').slideUp('slow', window.location.reload); 
}, 5000); 
+0

Gracias xdazz lo tendrá en cuenta. – Arish

1

Probar esto a continuación

<html> 
<head> 
<script type="text/JavaScript"> 
<!-- 
    function timedRefresh(timeoutPeriod) { 
    setTimeout("location.reload(true);",timeoutPeriod); 
} 
// --> 
</script> 
</head> 

<body onload="JavaScript:timedRefresh(5000);"> 
    <p>This page will refresh every 5 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.</p> 
    <p>But hey, try not to annoy your users too much with unnecessary page refreshes every few seconds!</p> 
</body> 
</html> 
+0

Gracias por la respuesta, ya encontré la solución de Fabrizio :) – Arish

1

También puede utilizar

window.location.href = window.location.href 

guión reescrito como

setTimeout(function() 
{ 

    $('#alert-success').slideUp('slow').fadeOut(); 
    window.location.href = window.location.href 

},5000) 
Cuestiones relacionadas