Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of "Enable native XMLHTTP support" option in IE

Our website uses AJAX call and uses XMLHTTPRequest to acheive that. When client uses an single IE instance through out the day and countinously navigating and refesing the page with in that IE, we end up with out of memory exception and forced to close the IE.

By enabling the option Enable native XMLHTTP support in Advnaced tab of IE fixes the issue. Since we prefers native XMLHTTP object over ActiveXObject, the exception might be caused due to using ActiveXObject. But still not sure what could be the root cause or is there any other better way to solve the issue. We use IE8. We have never encounterd any such issue in other browsers(Firefox and chrome). Thanks

like image 243
Al. Avatar asked Apr 27 '12 09:04

Al.


People also ask

Does IE support XMLHttpRequest?

All modern browsers (Chrome, Firefox, Edge (and IE7+), Safari, Opera) have a built-in XMLHttpRequest object.


2 Answers

Enable native XMLHTTP support means that the browser will not provide MSXML.HttpRequest but instead window.XMLHttpRequest that is standards compliant. We successfully used however both versions without any leakage whatsoever, so I guess it must be some implementation issue in your code - I am just guessing, but pinning MSXML.HttpRequest instances on DOMNodes (via an eventlistener) can lead to such situations.

like image 178
Peter Aron Zentai Avatar answered Oct 21 '22 11:10

Peter Aron Zentai


"Enable native XMLHTTP support” option in IE, unsurprisingly, makes IE provide native support for XMLHTTPRequest. If you don't enable this, you'll only have legacy ActiveX binding to MSXML library in IE. I guess you use some library that provides cross-browser handling for cases where native support is absent (setting turned off or older IE that only have legacy interface) or manually fallback to MSXML. Since MSXML binding is an alien interface for JavaScript, there are many places where objects introduced from outside JS can form cross-references with native objects, not letting either JS or ActiveX garbage collector to reclaim them, since they don't communicate and can't find such circular references.

Best solution, in my opinion, is to recommend IE7 users to always have this option on (there's really zero drawbacks to it) and just forget about older browsers. If this is not an option somehow, try recursively clear all MSXML objects you create in your fallback code.

like image 45
Oleg V. Volkov Avatar answered Oct 21 '22 13:10

Oleg V. Volkov