首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JS代码为什么会提示缺少对象解决办法

2012-04-14 
JS代码为什么会提示缺少对象script typetext/javascript!--var whatsNew open(,_blank,top5

JS代码为什么会提示缺少对象
<script type="text/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>


[解决办法]
如果没有拦截设置,是可以的
IE8测试是可以的
<script type="text/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>

热点排行