Any way to break out of Iframe after action is complete?

  • Thread starter Thread starter paperchaser
  • Start date Start date
P

paperchaser

Guest
Just working on some site design, and was wondering if its possible to break out of an iFrame after an action is completed within it? Is there a script that can monitor the Iframes contents and then break out when it changes?

Any help is appreciated!!
 
try this between <head></head>

create a new function (in javasctipt) to call the time (in seconds) before loading this.
Code:
<script language="Javascript">
<!--
if (top.location!= self.location) {
top.location = self.location.href
}
//-->
</script>
 
Code:
<script>
setTimeout ("if (top.location!= self.location) { top.location = self.location.href; }", 5000)
</script>
This will work after 5 seconds :-)
 
Code:
<script>
setTimeout ("if (top.location!= self.location) { top.location = self.location.href; }", 5000)
</script>
This will work after 5 seconds :-)

Should I place that code in the iframe? Something like:

Code:
<iframe name="MyIframe" id="MyIframe" src="http://iframedurl.com" scrolling="no">
<script type="text/javascript">
setTimeout ("if (top.location!= self.location) { top.location = self.location.href; }", 5000)
</script>
</iframe>

I tried that but it doesn't seem to work. As soon as I submit the form the page still stays in the iframe? Any help is appreciated!
 
Back
Top