ajax.onreadystatechange=function() { if (ajax.readyState==4) { alert(ajax.responseText); } } ajax.send(null);