Ajax is a combination of XMLHttpRequest objects and JavaScript, CSS, HTML, Dom and many other technologies.
The following features of XMLHttpRequest are highlighted here, so testers should consider using multiple browsers to test the compatibility of the page when testing the AJAX application pattern to the Web:
1, it is not a standard, so for different browsers have different initialization method.
2, generally only consider two kinds of situations: IE browser & non-IE browser (such as Firefox,safari,opera).
This is reflected in the code:
if (window. XMLHttpRequest) {
httprequest=new XMLHttpRequest (); //non-IE browsers instantiate the XMLHttpRequest object as a local JavaScript object .
}else if (window.activexobject) {
try{//ie Browser to instantiate the XMLHttpRequest object as an ActiveX object, the two formats are as follows .
Httprequest=new ActiveXObject ("msxml2.xmlhttp");
}catch (e) {
try{
Httprequest=new ActiveXObject ("Microsoft.XMLHTTP");
}catch (e) {
}
}
}
AJAX application development Model of Web (iii) development of--ajax