<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title>多點幾次“open?mywindow”按鈕,“close?mywindow”按鈕就只能關閉最近的一個窗口,怎么回事兒?</title>
</head>
<body>
<input?type="button"?value="Open?myWindow"?onclick="openWin()"/>
<input?type="button"?value="Close?myWindow"?onclick="closeWin()"/>
<script?type="text/javascript">
????function?openWin(){
????????myWindow=window.open("","","width=400,height=200");
????????myWindow.document.write("This?is?myWindow");
????}
????function?closeWin(){
????????myWindow.close();
????}
</script>
</body>
</html>
2015-11-28
因為你的邏輯就是控制最近的一個窗口啊