function stateChanged( xmlHttp, div ) { // The value of 'div' checks out fine.. no error there // But document.getElementById( div ) doesn't work anymore now that // I've put this into this function... document.getElementById( div ).innerHTML = "Loading... please wait."; if( xmlHttp.readyState == 4 || xmlHttp.readyState == "complete" ) { document.getElementById( div ).innerHTML = xmlHttp.responseText; } }