简体   繁体   English

在父窗口的新标签页中打开iframe链接

[英]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. 我有一个iframe和嵌入iframe的主窗口。 The iframe has a form where the user can input data and finally submit it. iframe具有用户可以输入数据并最终提交的表单。

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. 这会在父窗口中打开iframe表单的页面结果,因此包含iframe的窗口现在会加载新的结果页面。

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. 我猜我们可以在此处使用href来加载新标签。 But the form submission has an onclick event which processes the input and chenges the result page url accordingly. 但是表单提交有一个onclick事件,该事件处理输入并相应地调整结果页面的url。 Is there any simple solution to do this? 有任何简单的解决方案吗?

_parent target is working correct, you need to select the top window and use _blank _parent目标工作正常,您需要选择顶部窗口并使用_blank

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM