The responseText is empty in Firefox, but ok in Internet Explorer.
I also log the response before returning to the client so I can see my response there.
This is my request , I added a setTimeout but this also not helping.
var ajaxUrl = "./ajaxHandlers/ajax-handler.php";
var myAjax = new Ajax.Request(
ajaxUrl,
{
method: 'post',
parameters: params,
onComplete: function(response)
{
setTimeout(handleResponse(response,callback) ,5000);
}
});
function handleResponse(response,callback)
{
alert(response.responseText);
try
{
eval("var r = " + response.responseText);
}
catch (e)
{
alert("EXCEPTION = " + e.constructor);
showError("error evaluating response : Response text:<br/>" + response.responseText);
var r = new Object();
r.message = 'Error evaluating response';
r.status = 'error';
if (typeof callback == 'function') callback(r);
return;
}
}
In the onComplete your callback variable is not defined so this causes your problem :
or
Edit:
Here is the full code I have. It is working absolutely ok on FF 3.5.10 .. hmm not the latest but should be the same. I can confirm the ajax is synchronous because of the order of the console.info output statements :