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

关于setTimeout()时间无效?该如何处理

2012-03-26 
关于setTimeout()时间无效?htmlheadmetahttp-equiv Content-Type content text/htmlcharsetgb

关于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 ");

热点排行
Bad Request.