When we write the ASP code, everyone knows the data that can get the FORM form with POST or GET, then how do we get the data on other pages? This should be used by the XMLHTTP protocol. XMLHTTP is part of XMLDOM technology.
The following code is a very simple example, we use XMLHTTP technology, completely acquire the code of http://www.codetoad.com/-site home page, and output it in the page.
<%
DIM Objxmlhttp, XML
SET XML = Server.createObject ("Microsoft.xmlhttp")
XML.Open "get", "http://www.codetoad.com/", FALSE
'Pull The Data from The Web Page
Xml.send
Response.write "here's the html we now have in our xml object"
Response.write "
"
Response.write "
Response.write Xml.ResponseText
Response.write " xmp>"
Response.write "
"
Response.write "Now here's how the page looks:
"
Response.write Xml.ResponseText
SET XML = Nothing
%>
Here is another example
<%
DIM Objhttp, Objxml, Objxsl
Set objhttp = server.createObject ("Microsoft.xmlhttp")
Objhttp.open "get", "http://p.moreover.com/cgi-local/page?c=pop music reviews&o =xml", False
Objhttp.send
Set objxml = objhttp.responsexml
Set objxsl = server.createObject ("Microsoft.xmldom")
Objxsl.async = false
Objxsl.load (Server.MAppath ("style.xsl")))
IF (objxsl.parseerror.errorcode = 0) THEN
Response.write (objxml.transformnode (objxsl))
Else
Response.write "Error:" & objxsl.parseerror.reason & "URL:" & objxsl.url
END IF
Set objhttp = Nothing
Set objxml = Nothing
Set objxsl = Nothing
%>
Style.xsl:
hEAD>