我想在iframe关闭之后重新加载页面,它在加载时重新加载吗?

时间:2014-12-30 11:16:43

标签: javascript php jquery iframe

我想在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>

1 个答案:

答案 0 :(得分:2)

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

parent.window.location.reload();

iframe在parent.window

如果iframe没有弹出使用:

parent.document.location.reload();