'Opening an Iframe link in a new tab on the parent window

I have an iframe and the main window where the iframe is embedded. The iframe has a form where the user can input data and finally submit it.

Right now I use

var openURL = '/results/finalpage';
window.open(openURL, '_parent');

This opens the page result of iframe's form in the parent window and thereby the window which contained the iframe is now loaded with the new result page.

So I want to open results of the form in a new tab on the parent window. I am guessing we could use a href here to load in new tab. But the form submission has an onclick event which processes the input and changes the result page url accordingly. Is there any simple solution to do this?



Solution 1:[1]

_parent target is working correct, you need to select the top window and use _blank

var openURL = '/results/finalpage';
top.open(openURL, '_blank');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bruno Sousa