<script>var a;function try_a(){alert(a);}</script><input type="button" name="click me" onclick="window.open('2.html')">
<input type="button" name="close" onclick="window.opener.a = 'test'; window.opener.try_a(); window.close();">