|
I think it might have to do with your XMLHttpRequest.open() call - the third argument set to true indicates asynchronous calls. Which means when you try to read it, you haven't got the full document yet.
Please don't try to convert to synchronous XMLHttpRequests - they're not very nice. Instead, look into event handlers that XHR's provide.
|