ASP做聊天室,在显示框中显示时实现聊天对象的超链接出了问题...
我在显示框中显示时,把发言者及发言对象都实现了超链接,以便用户选择对象时,在显示框中点一下即可。
SayStr="<font color='#1e90ff'>"&_
"<a href='Chat_Input.asp?Selected="&userName&" target='Input'>"&userName&"</a></font>对<font color='#1e90ff'>"&_
"<a href='Chat_Input.asp?Selected="&towho&" target='main1' >"&towho&"</a></font>"&"说:"&TalkAbout
然后再显示:
<script language=javascript>
parent.Msg.document.write("<%=SayStr%><BR>")
</script>
在Input.asp中,聊天对象:Session("towho")=Trim(request("Selected"))
但运行时,如果用户名为英文名,则聊天对象的链接没问题;若是中文名,则链接后,对象显示框中为一些奇怪的汉字(很难认识),不知为何?
另外我在在线用户列表中显示时,采用:
response.write "<a href='chat_talk.asp?Selected= " % >
<%=Username%>
<% response.write " target='Input' >"%>
<%=Username%>
<% response.write "</a><BR>"%>
结果正确无误。