0

我面临一个大问题(至少对我来说)

在点击网页上,我打开 window.open() 并包含一个页面,该页面包含 iframe,但 window.close 在 iframe 中不起作用。

这是我要打开window.open的onclick

 <a onclick="window.open('http://localhost:8080/xyz.jsp', 'tool','width=720,height=500,resizable=yes,scrollbars=yes');return false;" target="tool" href="#" class="nav5b">new style</a>

这是 localhost:8080/xyz.jsp 中 window.open 中的 url

这是框架即将到来

  <frameset>
        <iframe id=someid" width="700" src="http://localhost:8080/test.form" name="frame1" scrolling="yes">
    </frameset>
4

2 回答 2

2

你有没有尝试过

parent.window.close();
于 2013-05-03T10:15:13.673 回答
1

" top" 更好,以防你有超过 2 个级别的 iframe“深度”。这是一个很好的链接:window、window.top和window.parent有什么区别?

于 2013-05-03T10:32:46.847 回答