javascript特效问题!

来源:百度知道 编辑:UC知道 时间:2024/05/27 17:48:34
请问下这组代码为什么在网页上无法显示啊!
还有在运用函数什么时候要申明变量啊.请一一解答!
在此先谢谢了!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<script>
var bar = 0 ;
var line = "||";
var amount ="||" ;
count() ;
function count(){
bar= bar+2 ;
amount =amount + line ;
document.value=amount ;
document.value=bar+"%" ;
if (bar<99)
{setTimeout("count()",200);
}
else
{window.location = "http://baidu.com";
}

}<

这个代码不是好着吗?
作用只在20秒之后打开http://www.baidu.com对吧.我试过了.可以的哦

你等一会它自动会打开百度的主页