Ver Mensaje Individual
  #9 (permalink)  
Antiguo 20/05/2010, 16:09
Avatar de wiwi74
wiwi74
 
Fecha de Ingreso: marzo-2008
Mensajes: 515
Antigüedad: 16 años, 2 meses
Puntos: 10
Respuesta: Saber cuantos iframe tiene la ventana hija

<!-- crea un html con este codigo dentro -->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>

<!-- Para que el link no funcione como tal debes hacer esto href="#"-->
<a href="#" title="" onclick="hija=window.open('con_iframe.html','newWi ndow','','')" >Click (popup)</a><br />
<form action="" name="formulario">
<input type="text" name="resultados" id="resultado" value="" />

<br /><input type="button"
onclick="document.formulario.resultado.value=hija. document.getElementsByTagName('iframe').length;"
value="Contar iframes" />
</form>

</body>
</html>








<!-- Ahora crea otro html y llamalo con_iframe.html -->
<!-- E insertale este codigo dentro -->
<!-- Esta sera la popu, fijate que en open() esta invocada-->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>

<h3>Soy una pagina con 3 iframe</h3>
<iframe name="newIframe" frameborder="1" ></iframe>
<iframe name="newIframe" frameborder="1" ></iframe>
<iframe name="newIframe" frameborder="1" ></iframe>

</body>
</html>



<!-- Fijate que compartan el mismo directorio -->


<!--
LEETE LOS PARAMETROS CORRESPONDIENTES AL METODO open()
open(sURL, sNombre, sAtributos, bHistoria);
sURL: Indica la dirección de la página a abrir.
sNombre: Nombre de la ventana (util para abrir una segunda dirección sobre la misma ventana.
sAtributos: Definidos posteriormente.
bHistoria: Si la nueva dirección se abre sobre una ventana existente, este indicador dice si debe o no añadirse al historial.
-->

Última edición por wiwi74; 20/05/2010 a las 16:15