开发者

Why does Firefox not clear "Connecting..." message after JSON data request?

Under FireFox 4.0 or 5.0, I create a requ开发者_如何转开发est 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 iframe then you will need to call document.close() on the iframe window.


I think there is some issue with FF 4/5, tabs showing connecting most of the time. It is not that there is any issue in your code but problem with the browser. Take a look at this topic on the Mozilla help site which blames an add-on called "TabRenamizer". If you are open to use jQuery then we can have some alternative to try and see.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜