[REBOL] =?iso-8859-2?Q?M=24XMLHTTP=20=3C=2D=3E=20Rebol?=
From: rebol-list2::seznam::cz at: 16-Jul-2001 13:22
Hi,
maybe someone may find it useful (you can get data from Rebol
without refreshing the page in IE):
browser part:
<script type="" language="JavaScript">
function HTTPPost(data) {
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST","http://your_server/cgi-bin/xml-echo.r", false);
xmlhttp.Send(data);
return xmlhttp.responseXML;
}
alert(HTTPPost("test=aha").xml);
</script>
and the Rebol part (%xml-echo.r):
#!c:/bin/rebol -cs
REBOL[
title: "XML-echo"
author: "Oldes"
e-mail: [oldes--bigfoot--com]
]
either empty? system/options/cgi/query-string
[
tmp: load any [system/options/cgi/content-length "0"]
data: make string! (tmp + 10)
while [tmp > 0][tmp: tmp - read-io system/ports/input data tmp]
][ data: system/options/cgi/query-string]
cgi: make object! decode-cgi data
print "Content-Type: text/xml^/"
print rejoin [{
<response>
<cgi>
} mold cgi {
</cgi>
<query-string>
} data {
</query-string>
</response>}
]
cheers Oldes
______________________________________________________________________
Vse pod jednou strechou - squash, Ricochet, aerobik, solaria, sauna,
posilovna, sport shop, sport bar, masaze - http://www.squashpoint.cz