During a recent project with a bent on improving UI we decided to take a look at what happened if an over zealous IT administrator in a company decided to disable activeX on his pure Internet Explorer environment. The results were disturbing therefore justifying the mantra that mission critical apps should still be functional without javascript and ajax. (Makes you want to dive into Flex huh? All that environment to do with as you please.) The good folks over at JQuery believe that IE 7’s implementation of native AJAX, i.e. a request that is not reliant on ActiveX such as Firefox, is flawed, so they simply use the ActiveX object. You can see this in the jQuery source
(at about line 2290 in 1.2.1):
This becomes a problem when you use jQuery exclusively and the aforementioned authority challenged IT admin has been allowed to run his path. We made our way around this by taking the Browser detect code from QuirksMode and writing a small piece of JavaScript that tries to create an ActiveX object when the browser is reported as IE.
Now all of our ajax type code is wrapped in:
I dont know if there is another way around this with jQuery, but it works for our purposes right now. I would be interested to know if any jQuery’ers out there can share a better solution. Further reading:
- Today is brought to you by the letters AJAX and IE(7)
- IE 7 – Native xmlHttpRequest Not So Good
- IE7 Supports XMLHTTPRequest Natively
Oh, and to test if your app will work properly go into Tools > Internet Options > Security > Internet > Custom Level > and disable “Run ActiveX controls and plugins” and “Script ActiveX controls marked safe for scripting*”, restart IE and go take a look at your site.