移动积分会过期吗:高手们来帮忙啊!以下的JSCRIPT脚本程序为什么没有运行啊?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 04:16:38
代码如下:
<html>
<head>
<title>登陆社区</title>
<script language="JavaScript">
function getCookieVal(offset){
var endstr=document.cookie.indexOf(";",ofFset);
if(endstr==-1)
endstr=document.cookie.length;
return unescape(document.cookie.substring(offset,endstr));
}
function GetCookie(name){
var arg=name+"=";
var clen=document.cookie.length;
var i=0;
while (i<clen){
var j=i+alen;
if (document.cook.substring(i,j)==arg)
return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if(i==0)break;
}
return null;
}

funcion Who(){
var VisitorName=GetCookie("VisitorName")
if(VisitorName==null){
t=""
return t
}
return VisitorName;
}
</script>

<script>
function valid()
{
if (document.form1.name.value=='')
{
alert("请先输入用户名!");
document.form1.name.focus();
document.form1.name.select();}
else if (document.form1.pwd.value=='')
{
alert("请先输入密码!");
document.form1.pwd.focus();
document.form1.pwd.select();}
else
{
document.form1.submit();
}
}
</script>

</head>

<body>
<p>
<font color="#000060"size="2'>
<script>
mydate=new Date();
myhour=mydate.getHours();
if(myhour<6)
welcome="夜里好";
else if(myhour<8)
welcome="早上好";
else if(myhour<11)
welcome="上午好";
else if(myhour<14)
welcome="中午好";
else if(myhour<19)
welcome="下午好";
else
welcome="晚上好";
tt=who()
document.write(tt);
document.write("用户");
document.write(welcome);
</script>
<br>
<form method="post"action="load.asp"name="form1">
<p>用户名:<input name="name"style="left:64px;top:75px"></p>
<p>密码:  <input name="pwd"type=password style="left:64px;top:75px"></p>
<p><input type=button value=登陆 onclick="valid()">
<input id=button1 name=button1 type=button value=注册 onclick="window.open('register.htm')"></p>
</form>
</font>
</body>
</html>

运行时只能显示那个表单,前面的问候语和关于表单的编程根本没有体现出来啊,如果没填写用户名点登陆也没有错误提示,这是为什么啊?好象这里面的JSCRIPT的程序根本没有运行啊?
大家来帮帮忙啊!
感谢!

<font color="#000060"size="2'> 和</font>应该去掉吧,感觉这么用不对.