Cita:
Iniciado por webosiris
con ese código lo único que logras es que tu sitio entre en un loop infinito de recargas cada 10 segundos... si lo que quieres hacer es que a los 10 segundos se ejecute ese js, hay formas mejores de hacerlo, por ejemplo puedes usar setTimeout(); (puedes buscar ejemplos en el foro de javascript)
te pongo los codigos que estoy usando
mate
Código HTML:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<META HTTP-EQUIV="REFRESH" CONTENT="10;URL=javascript:closeInfoBar()">
javascript
:
Código HTML:
<div style="z-index:16">
<div id="infobar" style="padding:4px 4px 4px 4px;position:fixed;z-index:999;left:0px;top:-100px;width:100%;border-bottom:1px solid #000000;background-color:#EEEEEE">
<span style="color:#000000;font-size:12px;font-family:Arial;font-weight:normal;font-style:normal;text-decoration:none;padding:0px 0;"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><center><br><br><br><br><br><br><br><center><img src="http://l2worldplus.webcindario.com/cargando.gif"><br> <strong>Esta cargando los archivos, Cuando este listo sera visible la web </strong><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></span>
</div>
<script type="text/javascript">
function showInfoBar()
{
var infobar = document.getElementById("infobar");
var top = parseInt(infobar.style.top);
if (top < 0)
{
top += 5;
infobar.style.top = top+"px";
setTimeout(function(){showInfoBar()}, 0);
}
else
{
if (document.all && !window.XMLHttpRequest)
infobar.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"');
else
infobar.style.top = 0;
}
}
function closeInfoBar()
{
document.getElementById("infobar").style.display = "10";
}
function initInfoBar()
{
var docWidth = 800;
if (typeof window.innerWidth != 'undefined')
{
docWidth = window.innerWidth;
}
else
if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
{
docWidth = document.documentElement.clientWidth;
}
else
{
docWidth = document.getElementsByTagName('body')[0].clientWidth;
}
// document.getElementById("infobar").style.width = "100%";
var height = parseInt(document.getElementById("infobar").offsetHeight);
document.getElementById("infobar").style.top = height*(-1)+"px";
showInfoBar();
}
initInfoBar();
</script></div>
lo estoy usando para que tape todas las imágenes de la web demientra que carga ya que las imágenes son muy grandes aquí tienes la web para que la veas si sabéis otro código mejor para ocultar todo asta que cargue se lo agradecería mucho
www.l2worldplus.es.tl