gpt4 book ai didi

javascript - 在 iframe 中加载窗口

转载 作者:行者123 更新时间:2023-12-02 18:55:06 26 4
gpt4 key购买 nike

我的页面上有一个 iframe,其中包含一个可打开 xyz.com 窗口的链接。唯一的事情是它会自动在 iframe 之外打开此窗口。我已将此脚本嵌入到 iframe 页面中:

<script>
function open_win()
{
window.open("http://www.w3schools.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
}
</script>
</head>

窗口会显示,但当我只想让它显示在框架内时,它会显示在所有内容之外。

最佳答案

浏览器窗口中有网页,其中可以包含 iframe。

您不能将窗口放入 iframe 中。那将是窗口中网页中 iframe 中的窗口,这会很奇怪。

关于javascript - 在 iframe 中加载窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15454126/

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