Okay, I'm fried... I've been hammering on this for days and I can't figure it out... Code's going all spaghetti on me...
This works in IE but updates do not happen in Mozilla 2.0.0.6.
Scriptaculous library (1.7.1_beta3), Prototype (1.6.0_rc0) and zXML 1.0.2 are being used. Scriptaculous is being used to autopopulate a field. Once that field is selected, an updateElement call is made to "getData" (this function). This function then goes and fires a whole bunch of asychronous calls to the server to load data.
In IE, it gets all of the way through it... In Moz 2.0.0.6 it never gets into the onreadystate function even though the readystate does change from 1 to 4 and it does get a status of 200.
My guess is that the event is never getting called in Mozilla so it's never getting into the oXmlHttp.onreadystatechange function.
Ideas?
THanks!
Code:
function getData(fullAddress)
{
var fullAddressElement = document.getElementById("fullAddress");
fullAddressElement.value = fullAddress.innerHTML;
whereFieldElement = document.getElementById("whereField");
var whereField = whereFieldElement.value;
for (var x = 0; x <= document.dataEntry.length-1; x++)
{
var getElement = document.getElementById(document.dataEntry.elements[x].name);
var get = getElement.name;
var where = whereField + "='"+ fullAddressElement.value +"'";
var oXmlHttp = zXmlHttp.createRequest();
oXmlHttp.open("GET", "getValue.php?get=" + get + "&where=" + where, false);
alert (oXmlHttp.readyState);
oXmlHttp.onreadystatechange = function ()
{
if (oXmlHttp.readyState == 4)
{
alert ("in state -"+ oXmlHttp.readyState +"-");
if (oXmlHttp.status == 200)
{
getElement.value = oXmlHttp.responseText;
}
else
{
alert ("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate
}
}
};
alert (oXmlHttp.readyState);
oXmlHttp.send(null);
alert (oXmlHttp.readyState);
alert (oXmlHttp.status);
}
}