a.html:
<html> <head> <meta charset="utf-8"> <title>open</title> </head> <body> <input type="button" value="打开B页面" onClick="window.open('b.html')"> <input type="button" value="打开B页面" onClick="window.open('b.html','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')"> </body> </html>'b.html' 弹出窗口的文件名;
<html> <head> <meta charset="UTF-8" /> <title>close</title> <script type="text/javascript"> function closeme(){ var browserName=navigator.appName; if (browserName=="Netscape") { window.open('','_parent',''); window.close(); } else if (browserName=="Microsoft Internet Explorer") { window.opener = "whocares"; window.close(); } }; </script> </head> <body> <input type="button" value="关闭当前页" onclick="closeme();"> </body> </html>_blank 表示新开一个窗口,