tags:

views:

35

answers:

2

I am loading an external page in an iFrame that redirects after a counter. I want to disable the redirect.I used firebug to locate the redirect.

if(!counter)
  self.iframe.src=self.vars["someurl"];

So how do I stop this redirect from happening?

Thank you, Todd

+2  A: 

You can't control JavaScript that comes from a different domain (which is what I am assuming you are doing, when saying "external page").

If you think a bit about browser security, you will understand why.

See Same Origin on wikipedia for details.

Oded
That is exactly what I meant. Security issue makes sense. So there is no way to control the browser and not redirect?
maddogandnoriko
@maddogandnoriko - Not really. The site owner implemented a frame buster for a reason... they don't want their site to appear in a frame.
Oded
A: 

Maybe counter = -1?

I mean, typing counter = -1 in Firebug before the counter goes to zero.

Edgar Bonet
`window.counter` is set on a per document basis. The document loaded into the iframe is a different document.
David Dorward