@alexusauthorAug 22.2008 — #get element by id givese me the same error stating that element (coresponding to the text fied) has no propertis ?
below is the full script that I need to make fully Mozilla compatibe. (it does work under IE) [code=php] /AJAX function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); alert("firefox detected"); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); //alert("Microsoft V2"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser does not support XML protocol, please check your settings"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ //document.myForm.time.value = ajaxRequest.responseText; alert(ajaxRequest.responseText); //Below lets process the request from server and output proper information to the users myArray=ajaxRequest.responseText.split("^"); alert(myArray[0]);
//lets find out what icon should we show /*if(myArray[0] == "stop"){ window.s_icon.innerHTML="<img border='0' src='images/stop_ico.gif' width='60' height='58'>"; }else if (myArray[0] == "warning"){ window.s_icon.innerHTML="<img border='0' src='images/warn_ico.gif' width='60' height='58'>"; }else if (myArray[0] == "info"){ window.s_icon.innerHTML="<img border='0' src='images/info_ico.gif' width='60' height='58'>"; } */
//Show the custom text //window.m_text.innerHTML = myArray[1]; document.getElementById(m_text).innerHTML = myArray[1];
//Check if we shoud disable user account if (myArray[2] == "disable"){ //window.myForm.auth_pass.style.backgroundColor="Red"; //window.myForm.accept.style.display ="none"; //alert("DISABLE");
//Maybe we just hide the input form on disable window.input_unit.style.display="none";
}
if(myArray[0] != ""){ //if we got the icon lets show message window //window.test2.style.display="block"; document.getElementById(test2).style.display="block"; }else{ document.getElementById(test2).style.display="none"; }
} }
//build request string with username //myRequest = "message.php?username=" + document.myForm.auth_user.value + "&site=" + mySite; myRequest = "message.php?username=" + document.getElementById(auth_user).value + "&site=" + mySite; //alert("Username: "+ myRequest); ajaxRequest.open("GET", myRequest, true); ajaxRequest.send(null); try{ //alert(ajaxRequest.status); ajaxRequest.status; }catch (e){ //ok the status returns nothing or gives an error so we would assume that connection error detected //alert("I did not get the status request confirmed"); //window.m_text.innerHTML="<b>WARNING</b><br>This is automated watchdog notification system. "; //window.s_icon.innerHTML="<img border='0' src='images/net_ico.gif' width='60' height='58'>"; //now lets show the window to the user //window.test2.style.display="block"; } }