xmlhttp.open("GET","getresponse.php?start="+ start
+ "&end=" + end,true);
In the line above, you specified true as the last parameter, not false.
Thus, AJAX becomes a synchronous call, the interprint will wait until answers appear.
But for each response check for null.
Ankit source
share