settimeout
Publicado por sandra (12 intervenciones) el 21/08/2006 22:16:54
Hola, espero que se encuentren bien.
Tengo un código en el cual quiero que una tabla aparezca después de un tiempo determinado, pero me marco un error de sintaxis, espero que lo puedan checar y me digan el porque no funciona, gracias.
<html>
<head>
<script>
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="object1";
yy=eval(y)+104;
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
function hacerAlgo() {
document.getElementById("Object1").style.display = "block";
}
</script>
</head>
<body onload='setTimeout('hacerAlgo()', 10000);setVariables();checklocation(); >
<FORM name='ValidForms' METHOD=POST ACTION="/cgi-win/bdieintsi.exe/Consultar">
<SCRIPT language=JavaScript>
<!--
if (screen.availWidth == 1024)
{ document.write("<div id='object1' style='display:none;position:absolute;visibility:show;left:785px;top:5px;z-index:2'>"); }
else
{ document.write("<div id='object1' style='display:none;position:absolute;visibility:show;left:585px;top:5px;z-index:2'>"); }
//-->
</script>
<table border=0 bgcolor= '#73BABD' width=190 cellpadding=0 cellspacing=1 style = "font-family: Arial; font-size: 9pt">
<tr><td align=center valign=middle bgcolor='CEEFF7'><font color='000000'><b>OPCIONES DE CONSULTA</b></font> <a href='/bdiesi/AyuCon.html'><IMG SRC='/bdieSI/ICONOS/ayudacon.GIF' ALIGN=TOP BORDER=0></a></td></tr>
<tr><td bgcolor='FFFFFF'><table border=0 cellpadding=0 cellspacing=0 style = "font-family: Arial; font-size: 9pt">
<tr><td colspan=3 height=2></td></tr>
<tr align=center><td width=3></td><td colspan=2><INPUT TYPE=Submit value='Consultar' class='boton1'>
<INPUT TYPE=reset value ='Borrar Selección' class='boton2'>
</td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><i>Ordenado por:</i></td></tr>
<tr><td width=5></td><td width=15></td><td><INPUT TYPE=RADIO value='A' NAME="Orden" checked><b>Año / Periodo</b></td></tr>
<tr><td width=5></td><td width=15></td><td><INPUT TYPE=RADIO value='P' NAME="Orden"><b>Periodo / Año</b></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><i>Rango de Fechas</i></td></tr>
<tr><td width=5></td><td width=15></td><td>Desde: <SELECT NAME="AAMin">
<OPTION SELECTED>2001
<OPTION>2002
<OPTION>2003
<OPTION>2004
<OPTION>2005
<OPTION>2006
</SELECT></td></tr>
<tr><td width=5></td><td width=15></td><td>Hasta: <SELECT NAME="AAMax">
<OPTION>2001
<OPTION>2002
<OPTION>2003
<OPTION>2004
<OPTION>2005
<OPTION SELECTED>2006
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Grafica" ><i>Gráfica</i></td></tr>
<tr><td width=5></td><td colspan=2><SELECT NAME="TipoGraf" class='lista1'>
<OPTION SELECTED>Líneas
<OPTION>Barras Verticales
<OPTION>Barras Horizontales
<OPTION>Área
<OPTION>Escalonada
<OPTION>Combinada
<OPTION>Logarítmica
<OPTION>Tendencia
<OPTION>Líneas 3D
<OPTION>Barras Verticales 3D
<OPTION>Barras Horizontales 3D
<OPTION>Área 3D
<OPTION>Escalonada 3D
<OPTION>Combinada 3D
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Exporta" ><i>Exportación</i></td></tr>
<tr><td width=5></td><td colspan=2><SELECT NAME="TipoExp" class='lista1'>
<OPTION SELECTED>Archivo formato .IQY
<OPTION>Archivo formato .XLS
<OPTION>Archivo formato .TXT
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Estadisticos" ><i>Estadísticos</i></td></tr>
<tr><td colspan=2 height=2></td></tr>
</table>
</td></tr></table>
</div>
</form>
</body>
</html>
Tengo un código en el cual quiero que una tabla aparezca después de un tiempo determinado, pero me marco un error de sintaxis, espero que lo puedan checar y me digan el porque no funciona, gracias.
<html>
<head>
<script>
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="object1";
yy=eval(y)+104;
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
function hacerAlgo() {
document.getElementById("Object1").style.display = "block";
}
</script>
</head>
<body onload='setTimeout('hacerAlgo()', 10000);setVariables();checklocation(); >
<FORM name='ValidForms' METHOD=POST ACTION="/cgi-win/bdieintsi.exe/Consultar">
<SCRIPT language=JavaScript>
<!--
if (screen.availWidth == 1024)
{ document.write("<div id='object1' style='display:none;position:absolute;visibility:show;left:785px;top:5px;z-index:2'>"); }
else
{ document.write("<div id='object1' style='display:none;position:absolute;visibility:show;left:585px;top:5px;z-index:2'>"); }
//-->
</script>
<table border=0 bgcolor= '#73BABD' width=190 cellpadding=0 cellspacing=1 style = "font-family: Arial; font-size: 9pt">
<tr><td align=center valign=middle bgcolor='CEEFF7'><font color='000000'><b>OPCIONES DE CONSULTA</b></font> <a href='/bdiesi/AyuCon.html'><IMG SRC='/bdieSI/ICONOS/ayudacon.GIF' ALIGN=TOP BORDER=0></a></td></tr>
<tr><td bgcolor='FFFFFF'><table border=0 cellpadding=0 cellspacing=0 style = "font-family: Arial; font-size: 9pt">
<tr><td colspan=3 height=2></td></tr>
<tr align=center><td width=3></td><td colspan=2><INPUT TYPE=Submit value='Consultar' class='boton1'>
<INPUT TYPE=reset value ='Borrar Selección' class='boton2'>
</td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><i>Ordenado por:</i></td></tr>
<tr><td width=5></td><td width=15></td><td><INPUT TYPE=RADIO value='A' NAME="Orden" checked><b>Año / Periodo</b></td></tr>
<tr><td width=5></td><td width=15></td><td><INPUT TYPE=RADIO value='P' NAME="Orden"><b>Periodo / Año</b></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><i>Rango de Fechas</i></td></tr>
<tr><td width=5></td><td width=15></td><td>Desde: <SELECT NAME="AAMin">
<OPTION SELECTED>2001
<OPTION>2002
<OPTION>2003
<OPTION>2004
<OPTION>2005
<OPTION>2006
</SELECT></td></tr>
<tr><td width=5></td><td width=15></td><td>Hasta: <SELECT NAME="AAMax">
<OPTION>2001
<OPTION>2002
<OPTION>2003
<OPTION>2004
<OPTION>2005
<OPTION SELECTED>2006
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Grafica" ><i>Gráfica</i></td></tr>
<tr><td width=5></td><td colspan=2><SELECT NAME="TipoGraf" class='lista1'>
<OPTION SELECTED>Líneas
<OPTION>Barras Verticales
<OPTION>Barras Horizontales
<OPTION>Área
<OPTION>Escalonada
<OPTION>Combinada
<OPTION>Logarítmica
<OPTION>Tendencia
<OPTION>Líneas 3D
<OPTION>Barras Verticales 3D
<OPTION>Barras Horizontales 3D
<OPTION>Área 3D
<OPTION>Escalonada 3D
<OPTION>Combinada 3D
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Exporta" ><i>Exportación</i></td></tr>
<tr><td width=5></td><td colspan=2><SELECT NAME="TipoExp" class='lista1'>
<OPTION SELECTED>Archivo formato .IQY
<OPTION>Archivo formato .XLS
<OPTION>Archivo formato .TXT
</SELECT></td></tr>
<tr><td colspan=3 height=2></td></tr>
<tr><td width=5></td><td colspan=2><INPUT TYPE=CHECKBOX NAME="Estadisticos" ><i>Estadísticos</i></td></tr>
<tr><td colspan=2 height=2></td></tr>
</table>
</td></tr></table>
</div>
</form>
</body>
</html>
Valora esta pregunta


0