It's not a secret anymore!
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem of Ajax in Firefox" Watch "Problem of Ajax in Firefox" New topic

Problem of Ajax in Firefox

NazneenAliza Shaikh

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() {"GET", url, true);

this.doSynchronousGet = function() {"GET", url, false);

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


Please help me.
Thanks in advance
I agree. Here's the link:
subject: Problem of Ajax in Firefox
It's not a secret anymore!