急!javascript编程问题

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:01:40
<body onload="textout()">
<form name="form1">
<textarea name ="text1" rows="10" cols="38"></textarea>
</form>
</body>
<script>
var pos=1;
var y="";
var x="传统的HTML语言不能开发交互式的动态网页";
function textout()
{
y=y+x.substring(0.pos);
document.form1.text1.value=y;
if(pos<=x.length)
setTimeout("textout()",800);
else pos=1;
}

</script>
打开IE,错误提示说第一行找不到对象,怎么回事。
你们方法我试了,不行啊

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script>
var pos=1;
var y="";
var x="传统的HTML语言不能开发交互式的动态网页";
function textout()
{
y=y+x.substring(0,pos);
document.form1.text1.value=y;
if(pos<=x.length)
setTimeout("textout()",800);
else pos=1;
}

</script>
</head>
<body onload="textout()">
<form name=&qu