[00:35:44 | Author: nid] Font Size: Large | Medium | the code below Small is passed in win2003 + IIS6.0 + (IE6/Netscape8.0/Firefox1.5)
Customer terminal htmlcode test.htm:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> Untitled Page </title>
<Script language = "javascript">
<! --
Function load (resource)
{
If (window. XMLHttpRequest)
{
XmlObj = new XMLHttpRequest ();
}
Else if (window. ActiveXObject)
{
XmlObj = new ActiveXObject ("Microsoft. XMLHTTP ");
}
Else {return ;}
XmlObj. onreadystatechange = handleResponse;
XmlObj. open ("GET", resource, true );
XmlObj. send ("");
}
Function handleResponse ()
{
If (xmlObj. readyState = 4)
{// XmlObj loaded
If (xmlObj. status = 200)
{
Var datas = xmlObj. responseXML. getElementsByTagName ("data ");
// Alert (datas [0]. firstChild. nodeValue );
Document. getElementById ("data"). innerHTML = datas [0]. firstChild. nodeValue;
}
}
}
-->
</Script>
</Head>
<Body>
<P>
<A href = "#" onclick = "load ('data. asp ')"> send a request </a> </p>
<Div id = "data"> here! </Div>
</Body>
</Html>
Server data. asp:
<% Response. ContentType = "text/xml" %> <? Xml version = '1. 0' encoding = 'gb2312 '?>
<Home>
<Data> Hustonline </data>
</Home>
Note: the first character of the xml document should be "<". There must be no leading space. Enter a character.