<html>
<body ><input type="button" onclick="opener.location.href='test1.html';window.close()" value="close">
</body>
</html>
前面是test1.html
test.html
<html>
<body>
<input type="button" onclick="window.open('test1.html','')" value="click">
</body>
看清楚打开前和打开后的button名.
<body ><input type="button" onclick="opener.location.href='test1.html';window.close()" value="close">
</body>
</html>
前面是test1.html
test.html
<html>
<body>
<input type="button" onclick="window.open('test1.html','')" value="click">
</body>
看清楚打开前和打开后的button名.
原test.html变成了test1.html(画面button,变为close)
<script>
window.onunload=uld;
function uld(){
window.opener.location=window.opener.location;
}
</script>
<body ><input type="button" onclick="opener.location.href='B.html';window.close()" value="关闭">
</body>
</html>
前面是B.html
A.html
<html>
<body>
<input type="button" onclick="window.open('B.html','')" value="BUTTON">
</body>
这下好了把