Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/06/2011, 23:10
Krohn
 
Fecha de Ingreso: marzo-2011
Mensajes: 4
Antigüedad: 13 años, 1 mes
Puntos: 0
Pregunta Problema con doble iframe en diferente dominio

Buenas!

Tengo los siguientes archivos html que se van llamando mediante iframes:

Pagina de acceso: http://dominio1.com/index.html

Código HTML:
<html>
  <head>
  </head>
  <body>
      <iframe name="ifr1" src="http://dominio2.com/index.html" width="800" height="1000" scrolling="no">
      </iframe>
  </body>
  </html> 
Pagina de dominio2.com/index.html

Código HTML:
<html>
   <head>
   </head>
   <body>
       <iframe name="ifr2" src="http://dominio3.com/form.html" width="400" height="400" scrolling="no">
       </iframe>
  </body>
</html> 
dominio3.com/form.html

Código HTML:
<html>
   <head>
   </head>
   <body>
   <form method='post' action='http://dominio3.com/check.php' target='_parent' id='cform'>
        <input type="text" name="inp1">
        <input type="submit" value="send">
  </form>
  </body>
</html> 
De esta forma, cuando el usuario accede a dominio1.com/index.html, el html resultando es:

Código HTML:
<html>
<head>
</head>
<body>
    <iframe name="ifr1" src="http://domain2.com/index.html" width="800" height="1000" scrolling="no">
        <html>
        <head>
        </head>
        <body>
        <iframe name="ifr2" src="http://domain3.com/form.html" width="400" height="400" scrolling="no">
             <html>
             <head>
             </head>
             <body>
             <form method='post' action='http://domain3.com/check.php' target='_parent' id='cform'>
                 <input type="text" name="inp1">
                 <input type="submit" value="send">
             </form>
             </body>
             </html>
        </iframe>
        </body>
        </html>
    </iframe>
</body>
</html> 
Bien, pues querria hacer que cuando el usuario haga el submit del formulario con action http://domain3.com/check.php, esa pagina no se abriera dentro de su iframe con nombre ifr2, sino que se abra en el iframe padre, con nombre ifr1.

El problema es que a pesar de definr el target="_parent" en el formulario, en FF y IE, cuando envias este, la pagina http://domain3.com/check.php se abre en un pestaña/ventana nueva, cuando deberia abrirse dentro del iframe llamado ifr1.

Creo que es por culpa de la diferencia de dominios entre el ifr1 y el ifr2, pero no he encontrado nada relacionado con ello por internet. Alguien podria comentarme como podria hacer para que se abra la pagina dentro del ifr1?

Muchas gracias por adelantado : )