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=trueonclick="refreshParent()" />

 

注意onclick后面的双引号一定不能少

 

原文地址:http://blog.sina.com.cn/s/blog_4a0c5a940100vza1.html

posted @ 2017-05-05 14:16  西湖看雪  阅读(268)  评论(0)    收藏  举报