【问题标题】:How to Reload a page from Iframe?如何从 iframe 重新加载页面?
【发布时间】:2014-08-27 12:52:22
【问题描述】:

我只是使用 iframe 登录和注册。 当出现他成功注册/登录的消息时,我需要重新加载页面。

例如 iframe 将是

当他在 iframe 中单击登录时,它会重新加载名为“login_success”的其他页面,此页面发送消息“成功登录”。

现在是我需要浏览器重新加载页面的问题,以便会话在加载 Iframe 的页面中工作。

感谢您的回复。

【问题讨论】:

    标签: php html iframe


    【解决方案1】:

    您可以使用以下脚本。

    window.parent.location.reload();
    

    【讨论】:

    • 我以前看过这段代码,但我不知道如何使用它
    • 请给我示例脚本。这样我就明白了。
    【解决方案2】:

    这里是

    document.getElementById('ifarme_id').contentWindow.location.reload();
    

    如果它在同一个域中,您可以在下面尝试

    var myframe = document.getElementById('Ifrme_id');
    myframe.src = myframe.src;
    

    【讨论】:

      猜你喜欢
      • 2011-12-20
      • 1970-01-01
      • 2014-09-23
      • 2013-06-22
      • 1970-01-01
      • 2011-09-22
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      相关资源
      最近更新 更多