En una página miPagina tengo un iFrame que carga otraPagina (que esta no es mía).
En todos los test que he hecho va todo perfectamente, pero hay una serie de usuarios que dejan de ver mi sitio web y son redirigidos a otraPagina, es decir, se sale del iFrame y se muestra en toda la página, dejando la mía de ser visible.
Hay alguna manera de combatir el código que tenga otraPagina para evitar esto?
Saludos!
EDITO Y AÑADO:
Supongo que esto es lo que hace la otraPagina:
Cita:
Me gustaría poder evitar que sin yo tener un script en mi pagina que lo permita, puedan cambiar el parent! Changing parent window's URL from IFRAME content
If you want to control parent window's URL from a child iframe, you can't use variable destination how you would use that for frames because tag <iframe> doesn't have this property.
Also you can't change parent.document.location variable because this variable is read-only for child iframes.
To solve this problem, you need to define a javascript function at parent window and call it from iframe window. Here's an example how to change parent window's URL:
Parent window's content:
<b>iframe starts here</b><br><br>
<iframe src='iframe1.html'></iframe>
<br><br>
<b>iframe ends here</b>
<script type="text/javascript">
function change_parent_url(url)
{
document.location=url;
}
</script>
Iframe's content:
IFRAME content<br><br>
<a href="javascript:parent.change_parent_url('http://yahoo.com');">
Click here to change parent URL </a>
So you can see that child iframe calls parent's function and gives URL to go to.
If you want to control parent window's URL from a child iframe, you can't use variable destination how you would use that for frames because tag <iframe> doesn't have this property.
Also you can't change parent.document.location variable because this variable is read-only for child iframes.
To solve this problem, you need to define a javascript function at parent window and call it from iframe window. Here's an example how to change parent window's URL:
Parent window's content:
<b>iframe starts here</b><br><br>
<iframe src='iframe1.html'></iframe>
<br><br>
<b>iframe ends here</b>
<script type="text/javascript">
function change_parent_url(url)
{
document.location=url;
}
</script>
Iframe's content:
IFRAME content<br><br>
<a href="javascript:parent.change_parent_url('http://yahoo.com');">
Click here to change parent URL </a>
So you can see that child iframe calls parent's function and gives URL to go to.