Connecting Tech Pros Worldwide Help | Site Map

system error -1072896748

Newbie
 
Join Date: Aug 2006
Posts: 1
#1: Aug 7 '06
Hi,

I am new to AJAX. This is my first project with AJAX and I am getting error "system error -1072896748" when I try to get the xmlhttp.responsetext

my html page:

<body onLoad="sendReq(url, stateChanged);">
<div id="txtOut">This will be replaced by xmlhttp.responsetext </div>

my .js:

var xmlHttp = createRequestObject();

function sendReq(url, handlerFunction) {
xmlHttp.onreadystatechange = handlerFunction;
xmlHttp.open('get', url, true);
xmlHttp.send(null);
}


function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
document.getElementById("txtOut").innerHTML = xmlHttp.responseText ;
}
}


the url in the xmlHttp.open is a call to a jsp page which is calling a method ProcessRequest in java to process the request.

The method in java to process the request is using the ServletOutputStream, something like this:

ServletOutputStream outputStream = response.getOutputStream();
lBytesRead = inputStream.read(bBuffer);
outputStream.write(bBuffer, 0, lBytesRead);
outputStream.flush();
outputStream.close();

PLEASE HELP

thanks,
Thuy
Newbie
 
Join Date: Sep 2006
Posts: 1
#2: Sep 1 '06

re: system error -1072896748


Hi,

I had the same problem. Got it working by replacing the following line in "CreateRequestObject"

xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
replaced by
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.5.0");

(Off course to be compatible with other IE versions you should make it a bit more general. E.g. http://www.multidesk.be/artikels/artikel/160/ section 4.1. Comment are in Dutch, but it should be easy to understand)

bye,
Tijskex
Reply