AJAX on IE - back to the IFRAME
On Internet Explorer in order to write AJAX based web applications you have to use an ActiveX object.
var request = new ActiveXObject("Microsoft.XMLHTTP");
On browsers that support the XMLHttpRequest object (Safari, Firefox) you instantiate your asynchronous http object as follows:
var request = new XMLHttpRequest();
Most AJAX apps have a browser check to determine which one to use.
Kae Verens recently pointed out in a blog entry that web sites that use AJAX won't work on IE when ActiveX controls are disabled in the security settings.
This is an important point to ponder when considering AJAX for a web application. Lots of companies will have ActiveX controls disabled, and keep in mind that IE is still the most popular web browser.
So how do you fix this? Back to using hidden
I have actually looked around for some discussion on IFRAMEs vs XMLHttpRequest (aka AJAX), but haven't found much. There are a few nice features of the XMLHttpRequest object, those mostly deal with access to headers, status codes, and other http details. Which is nice but you don't always need that info.
Are there any other advantages to using XMLHttpRequest objects over IFRAMEs?
Like this? Follow me ↯Tweet Follow @pfreitag
You might also like:
- Ajax Same Origin Policy No More with Firefox 3.5 - June 30, 2009
- Firefox Now Supports HttpOnly Cookies - July 19, 2007
- AJAX Presentation Outline - December 13, 2005
- Sessions don't work in Chrome but do in IE - February 6, 2019
- Cross Domain Data Theft using CSS - July 21, 2010
- jQuery UI Sortable Tutorial - January 7, 2010
- Firefox 3.5 Introduces Origin Header, Security Features - June 30, 2009
- Geolocation API for Adobe AIR? - October 8, 2008