I'm diving into the world of asynchronous JS communication, and everything appears to be working except my response state never hits 4.

I encode my data into a string called "post" which I send to the server like such:
Code JavaScript:
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", post.length);
req.setRequestHeader("Connection", "close");
with req of course being my XMLHttpRequest object. This data is sent to a PHP script which processes it, and then simply writes back (echoes to the page) "SUCCESS." I know that the query goes through successfully because it updates the database with the correct values from the query string.

For debugging I made my object alert its state onchange:
Code JavaScript:
req.onreadystatechange = function() {
	if( req.readyState == 4 ) {
		if( req.status == 200 || req.status == 304) {
			//update user interface
		} else {
			alert('The server encountered an error processing your request');
	} else {
		alert( req.readyState );
The script alerts 1, then 2, then 3, and then it stops. The query goes through, SUCCESS comes back from the request, but it never hits 4! Is this a race condition? I'm running this on localhost, but if I add sleep(10) to my PHP code before the echo then the execution simply changes to:
alert 1, (10 second pause), alert 2, alert 3, stop. If I remove my alerts it does the same thing, just stops, but the query goes through as is evident on page refresh.

Here are my firebug headers, not sure if that helps anything...shows SUCCESS coming back and the headers (dunno if they indicate a problem)