- 在OnUnload時,若執行了一個AJAX call,非同步的回應將不會觸發原本設定的callback。
[Solution] 改用Synchronous XHR。 - 若離開頁面時,還有任何Pending的XHR物件,將有可能佔用IE的Connection Pool。
[Solution] Tracking所有的XHR物件,在unload時,Abort所有的XHR Connection。 - 若有任何XHR物件的onreadystatechange沒有被重設(reset),會有memory leak。
[Solution] readyState是DONE的時候就重設onreadystatechange。
參考資料:
- Interrupted XmlHttpRequests cause IE to hang
- MSIE 6.0 'Permission Denied During Window Closing' Bug - Test Case
- The OnBeforeUnload and OnUnload Events Are Not Triggered in Internet Explorer 6 SP1 If the Body Tag Is Empty
- Making AJAX calls onUnload
- Re-inventing XMLHttpRequest: Cross-browser implementation with sniffing capabilities
No comments:
Post a Comment