天天看點

JS實作關閉目前子視窗,重新整理父視窗及調用父視窗的方法

一、JS實作關閉目前子視窗,重新整理父視窗

JS代碼如下:

<script>
  function refreshParent() {
   window.opener.location.href = window.opener.location.href;
   window.close();  
  }              
 </script>      

html頁面代碼如下:

<input type="button" id="btn1" class="btn" value="同意" disabled=true οnclick="refreshParent()"