This is the second part of my four-part series, Active Client Pages â€“ Ajax Approach. In this part of the series, we continue our discussion of the Ajax features we will need to use with ACP, and then we look at the principles of the Ajax approach.
By using the XMLHttpRequest object, a web developer can update a page with data from the server after the page has loaded! The XMLHttpRequest object is supported in Internet Explorer 5.0+, Safari 1.2, Mozilla 1.0 / Firefox, Opera 8+, and Netscape 7.
- new XMLHttpRequest() //IE7, Firefox, Safari etc;
- new ActiveXObject(“Msxml2.XMLHTTP”) //newer versions of IE5+;
- new ActiveXObject(“Microsoft.XMLHTTP”) //older versions of IE5+;
- new XDomainRequest() //IE8+ only. A more “secure”, versatile alternative to IE7’s XMLHttpRequest() object.
In IE6 and below, the XMLHttpRequest() is not supported, but instead relies on the proprietary ActiveXObject for Ajax requests. To create this object, and deal with different browsers, we are going to use a “try and catch” statement. Continue reading