The use of the Ajax Post XML method
function PostData (url,posteddata)
{
var xmlhttprequest= createxmlhttprequest ();
Call the encodeURI method two times
Posteddata = encodeURI (Posteddata);
Posteddata = encodeURI (Posteddata);
var url = URL;
Sending a request true to the specified URL indicates an asynchronous
Xmlhttprequest.open ("Post", url,true);
Post Submit Settings Item
Xmlhttp.setrequestheader ("Content-type", "Text/xml");
Set a callback function to handle the returned results
Xmlhttprequest.onreadystatechange=function () {Callback (XMLHttpRequest)};
Xmlhttprequest.send (Posteddata);
}
Here Createxmlhttprequest () and callback () are exactly the correct code.
The PostData () is called on the ASP Tutorial x page as follows:
function Getchangedcontent ()
{
var posteddata= document.forms[0].tl.func ("Getchangedxml", "2");
alert (posteddata);
PostData ("f_calcreport.aspx", posteddata);
}
The server gets the code as follows:
private void Modifydata ()
{
Try
{
XmlDocument document = new XmlDocument ();
Document.load (Request.inputstream);
}
catch (Exception e)
{
Response.Write (E.message);
}
}