Under FireFox 4.0 or 5.0, I create a request for JSON data with the following code:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.body.appendChild(script);
The JSON data arrives, my JSON handler processes it, but the “Connecting…” message in the tab remains forever. I also verified that Firefox closes the TCP connection afterwards. IE handles this normally. How can I indicate to the browser that the request has been completed so that the tab returns to a normal status?
It looks like you have to explicitly call
document.close()in FF.If you’re using
iframethen you will need to calldocument.close()on theiframewindow.