try something like:<script   language="javascript">
window.onbeforeunload   =   function() {
    var   n   =   window.event.screenX   -   window.screenLeft;
    var   b   =   n   >   document.documentElement.scrollWidth-20;
    if(b   &&   window.event.clientY   <   0   ||   window.event.altKey){
      //do something
    }
}
</script>

解决方案 »

  1.   

    父页面:<script>
    function aaa()
    {
    alert("parent window function");
    }
    </script>
    <a href="" onclick="window.open('csdn_onunload.htm')" target="_blank">aaaaa</a>
    子叶面,也就是 'csdn_onunload.htm'
    <body Onunload="opener.aaa();">hello</body>
      

  2.   

    Parent.htm<input name="aa" type="text"> <input type="button" name="submit" value="Open" onclick="window.open('Child.htm');">
    <script language="javascript">
    <!--
    function test()
    {
    alert("test");
    }
    //-->
    </script>
    Child.htm<input type="button" name="Close" value="Close" onclick="window.opener.aa.value='test';window.opener.test();window.close();">