Index. asp of the first File
<Script language = "javascript">
Var xmlHttp = false; // use ajax
Try {
XmlHttp = new ActiveXObject ("Msxml2.XMLHTTP ");
} Catch (e ){
Try {
XmlHttp = new ActiveXObject ("Microsoft. XMLHTTP ");
} Catch (e2 ){
XmlHttp = false;
}
}
If (! XmlHttp & typeof XMLHttpRequest! = 'Undefined '){
XmlHttp = new XMLHttpRequest ();
}
Function callserver ()
{
Var url = "index. asp ";
XmlHttp. open ("POST", url, true );
XmlHttp. onreadystatechange = update;
XmlHttp. setrequestheader ("content-type", "application/x-www-form-urlencoded ");
XmlHttp. send (null );
}
Function update ()
{
If (xmlHttp. readystate = 4)
{
Var xmldoc = xmlHttp. responseXML
Var info = xmldoc. getElementsByTagName ("info") [0]. text;
Alert (info );
}
}
Callserver ();
</Script>
The second login. asp
<%
Response. ContentType = "text/xml"
Response. Write ("<? Xml version = '1. 0' encoding = 'gb2312 '?> ")
Response. Write ("<root> ")
Response. Write ("<info> love you </info> ")
Response. Write ("</root> ")
%>