暑期繽紛巨獻之~------超級+無敵--------XML+javascript+ASP線上簡訊息功能!(8)

來源:互聯網
上載者:User
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)
}
}



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.