<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
var nw
function MM_openBrWindow(theURL,winName,features) { //v2.0
  nw= window.open(theURL,winName,features);
}
function check()
{
  if(!nw){alert("窗口还没有打开")}
  else{nw.close()}
}
//-->
</script>
</head><body bgcolor="#FFFFFF">
<a href="#" onClick="check();MM_openBrWindow('popup.html','','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a> 
</body>
</html>

解决方案 »

  1.   

    <body bgcolor="#FFFFFF">
    <a href="#" onClick="MM_openBrWindow('popup.html','openwin','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a> 
    </body>
    </html>改成上面这样就可以了~~
      

  2.   

    写上open的第2个参数不就可以了?
      

  3.   

    ('popup.html','加个名字','scrollbars=yes,resizable=yes,width=320,height=120')就这么简单
      

  4.   

    不用这么复杂function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }<a href="#" onClick="MM_openBrWindow('popup.html','win_1','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a> winName 起一个名字 win_1
    每次点击都会把 popup.html 载入 name = win_1 的窗口