I want to reload the page after closing the iframe bt it reloaded during load?

I want to reload the page after closing the iframe .. how to do it ??? I can not understand? please can anyone help me with this code?

 <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>

      

+3


source to share


1 answer


If you reload iframe and iframe popup use:

parent.window.location.reload();

      

iframe is in parent.window



if the iframe is not using the popup:

parent.document.location.reload();

      

+2


source







All Articles