![]() |
#2
anlige2008-09-03 01:03
|

<script language="vbscript" runat="server">
sub application_onstart
application.lock
dim msg(100)
for i=0 to 99
msg(i)="<br/>"
next
msg(100)="系统消息:欢迎来到简单聊天室<br/>"
application("msg")=msg
application.unlock
end sub
sub application_onend
end sub
</script>
sub application_onstart
application.lock
dim msg(100)
for i=0 to 99
msg(i)="<br/>"
next
msg(100)="系统消息:欢迎来到简单聊天室<br/>"
application("msg")=msg
application.unlock
end sub
sub application_onend
end sub
</script>
这是send.asp代码

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="5:url=msg.asp" />
<title>无标题文档</title>
</head>
<body>
<%
msg=application("msg")
for i=0 to 100
response.Write(msg(i))
next
%>
<script language="javascript">
top.mainFrame.scroll(0,document.body.scrollheight*10)
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="5:url=msg.asp" />
<title>无标题文档</title>
</head>
<body>
<%
msg=application("msg")
for i=0 to 100
response.Write(msg(i))
next
%>
<script language="javascript">
top.mainFrame.scroll(0,document.body.scrollheight*10)
</script>
</body>
</html>
我按照教程重启了服务器后运行send.asp结果出现了如下错误:
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'msg'
/asptest/msg.asp, 第 14 行
还有一个就是引号问题:
<input name="textfield" type="text" id="textfield" size="20" value="<%=session("user")%>" />
value后面有双重引号出现了,这段代码我上周五的时候不能正确执行,今天却能正确执行了.我想知道这样写是对的还是错的.有什么解决办法吗?
我看过了论坛置顶的关于引号的新手asp编程的基本法则,可他只讲了把双重代码编译到asp文件里应该怎么编,0没有讲在html代码里发生的双重引号应该怎么解决.而且他只讲了例子没有讲原理,好难理解啊.
请高手赐教,谢谢!
[[it] 本帖最后由 小树不修不直溜 于 2008-9-4 12:13 编辑 [/it]]