Java Reference
In-Depth Information
if (tempRequest.status == 200)
{
fpCallback(tempRequest.responseText);
}
else
{
alert(“An error occurred trying to contact the server.”);
}
}
}
this.request.onreadystatechange = request_readystatechange;
}
HttpRequest.prototype.createXmlHttpRequest = function ()
{
if (window.XMLHttpRequest)
{
var oHttp = new XMLHttpRequest();
return oHttp;
}
else if (window.ActiveXObject)
{
var versions =
[
“MSXML2.XmlHttp.6.0”,
“MSXML2.XmlHttp.3.0”
];
for (var i = 0; i < versions.length; i++)
{
try
{
var oHttp = new ActiveXObject(versions[i]);
return oHttp;
}
catch (error)
{
//do nothing here
}
}
}
return null;
}
HttpRequest.prototype.send = function ()
{
this.request.send(null);
}
Save this fi le as httprequest.js . You'll use it later in the chapter.
Search WWH ::




Custom Search