xml|線上 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ 超級+無敵--------XML+JAVASCRIPT+ASP線上簡訊息功能---介紹
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
---------下面的檔案就是包含WRITEXML函數的WRITEXML.ASP頁-----------
<%
Function WriteXml(Dom,Path,MyID,MyName,DATES,ONLY,Text)
On Error Resume Next
Dim R
Dom.Load Path
If Dom.parseError.errorCode <> 0 Then
WriteXml = True
Else
Set R = Dom.CreateElement("內容")
With R
.setAttribute "ID",MyID
.setAttribute "NAME",MyName
.setAttribute "DATE",DATES
.setAttribute "ONLY",ONLY
.Text = Text
Dom.documentElement.AppendChild R
End With
Application.Lock
Dom.Save Path
Application.unLock
End If
If Err.number<>0 Then
Err.Clear
WriteXml = True
End If
End Function
%>
-----------------------下面的是一個XMLCODE.JS檔案,包含CODE函數----------
function code(Str)
{
var A = new RegExp("'","gi")
var B = new RegExp("\"","gi")
Str = Str.replace(/&/gi,"&")
Str = Str.replace(/</gi,"<")
Str = Str.replace(/>/gi,">")
Str = Str.replace(A,"'")
Str = Str.replace(B,""")
delete(A)
delete(B)
return(Str)
}
---------------------下面的是一個PACE.JS檔案,包含PACE函數------------
// 檢查傳來的參數是否為空白字串,空返回TRUE,否則返回FALSE
function Pace(Str)
{
var Reg = new RegExp(" ","gi")
Str = Str.replace(Reg,"")
Reg = new RegExp("\r","gi")
Str = Str.replace(Reg,"")
Reg = new RegExp("\n","gi")
Str = Str.replace(Reg,"")
delete(Reg)
if(Str == "")
{
return(true)
}
else
{
return(false)
}
}
-------------------下面是XMLHTTP.JS檔案,包含SEND函數---------------
function Send(Str,URL)
{
var Http = new ActiveXObject("Microsoft.XMLHTTP")
var Dom = new ActiveXObject("Microsoft.XMLDOM")
Http.open("POST",URL,false)
Http.send(Str)
Dom.async=false
Dom.loadXML(Http.responseText)
if(Dom.parseError.errorCode != 0)
{
delete(Http)
delete(Dom)
return(false)
}
else
{
var Back = Dom.documentElement.childNodes.item(0).text
delete(Http)
delete(Dom)
return(Back)
}
}