I have a very simple page that loads links from a database into iframes. A problem I am having is that sometimes the link that is loaded into an iframe is no longer valid and the web server redirects you to another page (sometimes a login page). However, instead of redirecting the page inside the iframe, it redirects the entire page of iframes. Is there any way to prevent this from happening and force any redirected web pages in the iframe itself? The code that i'm using for the iframe is:
there is probably something that looks like target="_top" in the underlying page you are trying to load into the iframe. The fact that it is happening when no page is available suggests it is the default page being loaded. I do not think you can override the _parent or _top setting within the Iframe call. Q...
Thank you for your answer, can i at least not show the iframe when the redirect is being made so i can prevent this? Like caching the page or somthing like this.
Yes, it is possible (but not foolproof) to prevent an IFRAMEd web page from breaking out of that IFRAME. You may view an explanation here.
I'm using joomla, but the problem appears even in a simple html template without cms. I tried also to put 2 iframe's one inside another but i get the same result. I'll check back after i'll read the explanation above. thanks.
yes they probably use some frame brake code just to prevent that. You can try some frame brake brake tricks