I created this generic AJAX Handler to work with Firefox and IE. However, it seems that somewhere in updating Firefox to 2.0.0.9 that the handler assigned to onreadystatecha nge is no longer getting called. This still works for IE.
Can someone help me add to this so that I can get it working with Firefox again?
Can someone help me add to this so that I can get it working with Firefox again?
Code:
var ASYNCH = true;
var REQUEST_TYPE = 'POST';
var AJAX_URL = '/ajax.cgi';
function httpRequest() {
// Mozilla-based browsers
if (window.XMLHttpRequest) {
ajaxRequest = new XMLHttpRequest();
}
// IE-based browsers
else if (window.ActiveXObject) {
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
if(! this.ajaxRequest) {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
}
// The request could still be null if neither ActiveXObject
// initialization succeeded
if (! ajaxRequest) {
alert("Your browser does not permit the use of all of this " +
"application's features");
return false;
}
ajaxRequest.onreadystatechange = this.handler; // DOES NOT WORK IN Firefox 2.0.0.9
ajaxRequest.open( REQUEST_TYPE, AJAX_URL, ASYNCH);
ajaxRequest.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF=-8"
);
ajaxRequest.send( this.queryString );
return true;
}
Comment