A.html
<html>
<head>
<script type="text/javascript">
alert("refresh");
</script>
</head>
<body>
<a οnclick="javascript:window.open('b.html');">OpenNewWindow</a>
<body>
</html>
B.html
<html>
<head>
</head>
<body onUnload="javascript:opener.location.href='a.html';">
<a οnclick="javascript:window.close(this)">[CloseWindow]</a>
</body>
</html>