在子窗口加个beforeunload事件  调用父窗口对应的函数试试

解决方案 »

  1.   

    第一个页面
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>父窗口</title>
    <script type="text/javascript">
    var a=0;
    function fun(thisurl) {
        window.open(thisurl,"弹出页面","width=470,height=150,scrollbars=yes,resizable=no");
    }
    /*计算页面刷新次数*/
    function ss(){
    alert('已刷新'+(++a)+"次")
    }</script>
    </head>
     
    <body>
    <input type="button" value="打开" onClick="fun('Untitled-2.html')" />
    </body>
    </html>
    第二个页面
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>子窗口</title>
    <script type="text/javascript">
    function closeWin() {
        window.close();
    window.opener.ss();
    }
    /*刷新父窗口页面*/
    </script>
    </head>
     
    <body>
    <h3><a href="#" onClick="closeWin()">关闭窗口</a></h3>
    </body>
    </html>
      

  2.   

    那就把当前的数值存到cookie里 页面加载前先取下cookie的值试试