在iframe中加载窗口

时间:2013-03-16 20:06:24

标签: javascript iframe

我的网页上有一个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>

窗口显示,但当我希望它显示在帧内时,它会显示在所有内容之外。

2 个答案:

答案 0 :(得分:2)

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

您无法在iframe中放置窗口。这是窗口中网页中iframe的窗口,这只是奇怪的。

答案 1 :(得分:0)

要将新内容保留在iFrame中,也许您应该使用显示/隐藏图层。