• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem of Ajax in Firefox

 
NazneenAliza Shaikh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Experts,


i am having Ajax code which is running well in IE7.But the same code deosn't work in Mozilla Firefox 2 and 3.

Here is code .

function AJAXCall(url, callback,list,selected, enrichment) {

var req = init();
req.onreadystatechange = processRequest;

function init() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}

function processRequest () {

if (req.readyState == 4) {
if (req.status == 200) {
if (callback) callback(list,req.responseXML,selected, enrichment);
}
}
}

this.doGet = function() {
req.open("GET", url, true);
req.send(url);
}

this.doSynchronousGet = function() {
req.open("GET", url, false);
req.send(url);
}

this.doPost = function(body) {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(body);
}

}


Please help me.
Thanks in advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic