日期:2014-05-18  浏览次数:20676 次

以下代码为何无效?
<html>
<head> <title> DOM实例 </title> </head>
<body>
<script   language= "javascript ">
<!--
var   whatsNew=open( ", '_blank ', 'top=50,left=50,width=200,height=300,menubar=no,toolbar=no,directories=no,location=no,status=no,resizable=no,scrollbars=yes ');
whatsNew.document.write( ' <center> <b> 更新通知 </b> </center> ');
whatsNew.document.write( ' <p> 最后更新日期:00.08.01 ');
whatsNew.document.write( ' <p> 00.08.01:增加了 "我的最爱 "栏目. ');
whatsNew.document.write( ' <p   align= "right "> <a   href= "javascript:self.close() "> 关闭窗口 </a> ');
whatsNew.document.close();
//-->
</script>
</body> </html>

------解决方案--------------------
var whatsNew=open( ' ', '_blank ', 'top=50,left=50,width=200,height=300,menubar=no,toolbar=no,directories=no,location=no,status=no,resizable=no,scrollbars=yes ');

这句的问题。请看open()中的第一个参数。是两个单引号不是一个冒号……