【问题标题】:on click webpage open window.open() and that include frameset but window.close not working in frameset单击网页打开 window.open() 并包含框架集但 window.close 在框架集中不起作用
【发布时间】:2013-04-27 17:10:04
【问题描述】:

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

在点击网页上我打开 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>

【问题讨论】:

  • 你不能“关闭”一个 (i)frame ...

标签: javascript jquery css


【解决方案1】:

"top" 更好,以防您有超过 2 级的 iframe“深度”。这是一个很好的链接:What is the difference between window, window.top and window.parent?

【讨论】:

    【解决方案2】:

    你试过了吗

    parent.window.close();
    

    【讨论】:

    • 很高兴为您提供帮助。一个人与大局息息相关,以至于小事都逃不过你的注意。
    猜你喜欢
    • 1970-01-01
    • 2020-06-23
    • 2010-10-13
    • 1970-01-01
    • 2013-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-06
    相关资源
    最近更新 更多