Core.Web.HttpConnection provides a cross-browser wrapper around the XMLHttpRequest object that is the cornerstone of "AJAX" application development.
This wrapper provides the following benefits:
HttpConnection object wraps a XMLHttpRequest object. In the case of IE6, the Microsoft.XMLHTTP ActiveX object is usedonreadystatechange provided by XMLHttpRequest implementations.
The following example shows an HttpConnection object in use:
var conn = new Core.Web.HttpConnection("/process", "POST",
"<msg>Hello, world<msg>", "text/xml");
conn.addResponseListener(Core.method(this, function(e) {
if (!e.valid) {
alert("Error!");
return;
}
alert(e.source.getResponseText());
}));
conn.connect();