wood burning stoves 2.0*
The moose likes Web Services and the fly likes Problem of Ajax in Firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem of Ajax in Firefox" Watch "Problem of Ajax in Firefox" New topic
Author

Problem of Ajax in Firefox

NazneenAliza Shaikh
Greenhorn

Joined: Jan 17, 2008
Posts: 10
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem of Ajax in Firefox
 
Similar Threads
Struts 1 & JQuery & Ajax
Browser not supporting Autocomplete
IE 6 problem with Dates?
AJAX: request not sent properly
Struts 2 Autocompleter event trigger problem.