Hello,
My problem:
When the page is called outside the iframe, I would like redirect it to another page.
Eg: The page www.something.com/A.php has an iframe <iframe src="insideA.php"></iframe>
and when insideA.php is called outside the of page A.php - www.something.com/insideA.php - it should redirect to page B.php
Solution
I believe is a simple solution... But, I am not a developer, so maybe you can help me.
Please!
Redirect working just outside iframe
Moderator: General Moderators
Re: Redirect working just outside iframe
it's untested but should work.
Code: Select all
<script language="javascript">
<!--
if (top.location == location)
{
location.replace('http://your_website.com/redirect_page.php');
}
-->
</script>
Re: Redirect working just outside iframe
Thanks! It worked perfectly! cool... a simple JS!