Break out of iframe

We have a hosted quiz/survey (tryinteract.com) that we build into our site, either by simple iframe or by an iframe on a Lightbox. It works quite well, except the resulting answer on the quiz links to one of our actual products, so we would like the link to break out of the iframe and follow that link. The links are set at the 3rd party quiz site by us, of course.

Currently, we can set (at tryinteract.com) the links to open in new window, which works but is not elegant, or not to open in new window, which then loads the entire new link within the iframe (not good).

Any ideas?

Eric

Hi,

I’m afraid I don’t know of any other way to do it, except for the ones you mentioned.
As far as I know, it’s part of the idea behind iframe, to make it isolated and not affect the window it’s hosted (unless they are both from the same domain, which doesn’t seem like the case here).

Thanks,

Itay Koren

Thanks, I kind of assumed so, just trying to think if there’s a way around it… like linking inside the iFrame to a blank page that has some sort of break-out javascript code that points to a page and loads it in main window, etc.

Hello Eric,

As Itay mentioned, an Iframe is meant to be isolated from the rest of the page. You can access the topmost
—the one without a parent—is usually the browser window, represented by the Window object, maybe this will help you achieve what you are trying to do.

You can read more about Iframes and its properties - here
Window Object - here

Hope this helps,
Majd