【问题标题】:I want to Reload page after iframe close bt it reloaded at time of loading?我想在 iframe 关闭 bt 后重新加载页面,它在加载时重新加载?
【发布时间】:2015-02-26 13:24:42
【问题描述】:

我想在 iframe 关闭后重新加载页面.. 怎么做?我无法理解?请问有人可以在这段代码中帮助我吗?

 <div class="form-group border-none">
  <div class="col-md-12 ">
 <iframe src="<?php echo $this->base_url; ?>Profile_pic/index/<?php echo $id;   ?>" width="100%" style="border:none; height:52px;">
                    </iframe>
                </div>
             </div>           

       <script language="javascript" type="text/javascript">
            window.onload = function () 
            {
               if (! localStorage.justOnce) 
               {
                localStorage.setItem("justOnce", "true");
                window.location.reload();
                }
            }

        </script>

【问题讨论】:

  • 如何关闭 iframe?
  • 我使用了关闭按钮图片
  • 然后你应该在你的按钮点击事件上应用 websky 答案,它会起作用

标签: javascript php jquery iframe


【解决方案1】:

如果您使用 iframe 重新加载并且 iframe 弹出,请使用:

parent.window.location.reload();

iframe 在 parent.window 中

如果 iframe 不弹出使用:

parent.document.location.reload();

【讨论】:

  • 我只想重新加载一次??
  • 然后你也在那里设置相应的parent.window.localStorage.setItem("justOnce", "true");代码:)
猜你喜欢
  • 2023-03-31
  • 1970-01-01
  • 1970-01-01
  • 2014-09-23
  • 2014-01-08
  • 2012-08-02
  • 2013-10-04
  • 1970-01-01
  • 2010-12-24
相关资源
最近更新 更多