【发布时间】:2018-10-15 23:25:09
【问题描述】:
我在 chrome 上使用 iframe 有一个处于信息亭模式的站点,我在其中打开了许多外部站点。每个站点都有自己的链接,target="_blank"。我无法控制这些外部链接。 我只想在 iframe 中打开所有这些外部链接,或者我需要为这些 target=_blank 链接发布一些消息。我无法在自助服务终端上打开新窗口。到目前为止我已经搜索过,发现它必须是一些服务器端编码。 Javascript 在这方面没有任何帮助。
我的 iframe 代码:
navigateToExternal:function(href)
{
Engine.ui.openMenu();
Engine.ui.exit();
Engine.ui.mostRecentSection = "external";
$("a[data-navsection], a[href]").removeClass("disabled");
$("a[href='" + href + "']").addClass("disabled");
$(".footer").hide();
var sandbox = "sandbox=\"allow-forms allow-scripts allow-same-origin\"";
$("#content-container").append("<iframe id=\"contentFrame\" src=" + href + "\"" + sandbox + "></iframe>");
},
任何帮助或建议都会非常棒。
提前致谢!!
【问题讨论】: