gpt4 book ai didi

javascript - 在同一个 iframe 上打开 HTTPS 网站

转载 作者:行者123 更新时间:2023-12-03 01:26:59 25 4
gpt4 key购买 nike

我尝试使用链接控制 iframe 内安全网站的导航,但它始终在新选项卡或窗口中打开。它在不安全的网站中正常工作。这是我的代码:

<a href="#" onclick=window.open("https://www2.ecinteractiveplus.com/0463/Product/OND/VBD50BK/","iframe1");>Binders</a>
<a href="#" onclick=window.open("https://www2.ecinteractiveplus.com/0463/Product/UPG/BLU113/","iframe1");>Folders</a>

<iframe name="iframe1" src="https://www2.ecinteractiveplus.com/0463" style="min-height: 1100px;height:100%; min-width: 600px; width:100%;"></iframe>

非常感谢任何帮助!

最佳答案

这会起作用,只需确保 iframe 的 javascript 代码从 same origin 加载即可。 .

<a href="https://www2.ecinteractiveplus.com/0463/Product/OND/VBD50BK/" target="iframe1">Binders</a>
<a href="https://www2.ecinteractiveplus.com/0463/Product/UPG/BLU113/" target="iframe1">Folders</a>

<iframe name="iframe1" src="https://www2.ecinteractiveplus.com/0463" style="min-height: 1100px; height:100%; min-width: 600px; width:100%;"></iframe>

关于javascript - 在同一个 iframe 上打开 HTTPS 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51488318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com