【发布时间】:2019-06-01 23:33:46
【问题描述】:
我正在开发一个允许用户使用大量服务(spark 等)的网络应用程序。 当用户选择启动服务时,比如 Spark,应用程序将打开一个新选项卡,其中将包含我的页面(service.html),其中包含有关用户的一些信息,然后是 iframe,如下所示:
<table width="100%" style="padding: 0px;">
<tr>
<td align="right" style="padding: 0px;">
<i class="fa fa-wifi" style="color:gray;"> {{ some stuff}}</i>
</td>
</tr>
</table>
<iframe id="serviceIframe" width="100%" height="100%" frameborder="0" src="http://localhost:{{port}}/{{page}}" target="_self"/>
一切正常,但我的问题是,如果用户在 iframe 中的任何链接上单击“在新选项卡中打开”,它将转到 http://localhost:{{port}}/{{page}} ,而不是服务 html,我想在服务旁边显示的内容将会丢失。
我该怎么做,当用户点击 iframe 内链接上的“在新标签页中打开”时,它会重定向到我的 service.html 页面,而不是 http://localhost:{{port}}/{{页}}?
如果我不清楚,谢谢和抱歉。
【问题讨论】:
标签: javascript python html web