日期:2014-05-16  浏览次数:20400 次

关于setTimeout()时间无效?
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 操作成功 </title>
<script   language= "JavaScript "   type= "text/JavaScript ">
<!--
function   closewindow()
{
setTimeout(window.close(), "10000 ");
}

//-->
</script>
</head>

<body   onLoad= "closewindow() ">
<hr   align= "center "   width= "50 "   size= "10 "   color= "gray ">
<br>
投票成功!谢谢你的支持!
<br>
<hr   align= "center "   width= "50 "   size= "10 "   color= "gray ">

</body>
</html>

功能是实现10秒后自动关闭页面,可是很奇怪,好像这个页面一载入就自动关闭了,我把时间调长一点也是一样,是什么原因啊?

------解决方案--------------------
setTimeout( "window.close() ", "10000 ");