XML+JAVASCRIPT+ASP在线短信息功能(3)

作者:不详 来源: 日期:2002-8-30
------下面这个文件就是查看信息的GetInformation.htm文件,代码比较长.慢慢看看---------------

<html>
<head>
<title>回复信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style/style.css" type="text/css">
<link rel="stylesheet" href="../style/onlineInformation.css" type="text/css">
<script LANGUAGE="Javascript" SRC="../script/XmlCode.js"></script>
<!--上面加载了一个Code函数,用来替换回复的信息里的特殊字符-->
<script LANGUAGE="Javascript" SRC="../script/XmlHttp.js"></script>
<!--上面加载了一个XMLHTTP函数,是发送信息/取回发送返回值的函数-->
<script LANGUAGE="Javascript" SRC="../script/Pace.js"></script>
<!--上面加载了一个PACE函数,用来检查回复信息时,回复的内容是否为空,是就返回TRUE-->
<SCRIPT LANGUAGE=Javascript>
<!--
window.focus()

var Cursor = window.opener //上一层窗口对象
var NN = false
Cursor.parent.document.body.onunload = Close //首页关闭,本窗口就关闭,因为本窗口需要取得上层窗口的信息

if(Cursor.XmlDom.documentElement.childNodes.length == 0)
{
window.location = "NewInformation.htm" //如果用户按下刷新(F5),会导致数据无法取得并显示,转向发送新信息页面
NN = true
}
else
{
var XmlDom = Cursor.XmlDom.documentElement.childNodes.item(Cursor.Count-1)
var Name = XmlDom.attributes.getNamedItem("NAME").nodeValue
var Date = XmlDom.attributes.getNamedItem("DATE").nodeValue
var NodeText = XmlDom.text
var MissYou = XmlDom.attributes.getNamedItem("ID").nodeValue
}

function Close()
{
window.close()
}

function Init()
{
if(NN)
{
return
}

Format(Name,Date,NodeText)

if(Cursor.Count == Cursor.XmlDom_Length)
{
Cursor.ReMove()
}

}

function Format(To,Dates,Text)
{
document.all["to"].innerHTML = To
document.all["dates"].innerHTML = Dates
document.all["text"].value = Text
}


function eChangTextArea(Bool)
{
var A3;
var A2;
var A4;
var A5;
var A6;
var A7
if(Bool == true)
{
A2 = "#ffffff"
A3 = "#aaa697 1px solid "
A4 = ""
document.all["text"].value = A4
A5 = "<a href=\"javascript:FormSubmit()\">发送</a>"
A6 = "<a href=\"javascript:eChangTextArea(false)\">原始信息</a>"
A7 = "#DFDED9"
document.all["text"].disabled = false
document.all["text"].focus()
}
else
{
A2 = "#EBEAE7"
A3 = ""
A5 = "<a href=\"javascript:eChangTextArea(true)\">回复</a>"
A6 = " "
A7 = "#EBEAE7"
Init()
document.all["text"].disabled = true
}
text.style.border = A3
text.style.backgroundColor = A2
document.all["Send"].innerHTML = A5
document.all["k"].innerHTML = A6
document.all["client"].bgColor = A7
}

-->
</SCRIPT>

<SCRIPT LANGUAGE=javascript>
<!--
function FormSubmit()
{
var text = document.all["text"].value
if(Pace(text))
{
alert("Sorry.\b您所要回复的信息内容不能为空")
document.all["text"].focus()
document.all["text"].select()
}
else
{
hidden.style.zIndex = 5
Check(Send("<农村娃娃出品-必属精品><可爱QQ>" + MissYou + "</可爱QQ><可爱QQ>" +
 code(text) + "</可爱QQ></农村娃娃出品-必属精品>","MissYou.asp"))
}

}


function Check(OH)
{
if(OH == false)
{
Y(true)
}
else
{
if(eval(OH))
{
Y(true)
}
else
{
Y(false)
}
}
}

function Y(Bool)
{
if(Bool)
{
alert("Sorry.\b信息发送失败.请再试一遍")
hidden.style.zIndex = 0
document.all["text"].focus()
}
else
{
window.location = "NewInformation.htm"
}
}
-->
</SCRIPT>
</head>
<body bgcolor="#DFDED9" text="#000000" onload="Init()">
<div id="hidden" style="position:absolute; left:0px; top:0px; width:324px; 
height:214px; z-index:0; background-color: #DFDED9; layer-background-color: 
#DFDED9; border: 1px none #000000"> 
<table width="324" border="0" cellspacing="0" cellpadding="0" height="30">
<tr> 
<td height="100"> 
<div align="center"><img src="image/nowLoading.gif" width="180" height="29"></div>
</td>
</tr>
</table>
</div>
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:324px;
 height:214px; z-index:1"> 
<table width="324" border="0" cellspacing="0" cellpadding="0" class="BB">
<tr> 
<td width="54" bgcolor="#DFDED9"> 
<div align="left" id="F"><b>发信人:</b></div>
</td>
<td width="170" bgcolor="#DFDED9"> 
<div align="center" id="to"></div>
</td>
<td width="40" bgcolor="#DFDED9"><b>日期:</b></td>
<td width="60" bgcolor="#DFDED9"> 
<div align="center" id="dates"> </div>
</td>
</tr>
<tr bgcolor="#EBEAE7" id="client"> 
<td colspan="4" height="176"> </td>
</tr>
<tr> 
<td colspan="4"> 
<table width="324" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#DFDED9"> 
<td width="108"> 
<div align="center" id="Send"><a href="javascript:eChangTextArea(true)">回复</a></div>
</td>
<td width="108"> 
<div align="center" id="k"> </div>
</td>
<td width="108"> 
<div align="center"><a href="javascript:Cursor.OpenWin
('NewInformation.htm','NewInformation')">新信息</a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="Layer2" style="position:absolute; left:4px; top:20px; width:262px; 
height:169px; z-index:2"> 
<textarea id="text" disabled wrap="VIRTUAL" cols="45" rows="11" 
style="overflow: hidden; background-color: #EBEAE7; border: 1 solid #EBEAE7">
</textarea>
</div>
</body>
</html>


------------------------------------等等是发新信息的NEWINFORMATION.HTM代码-----------------
相关文章