}
不幸的是,上文中所提到的“大多數瀏覽器”并不包括IE,因此對于微軟的瀏覽器,我們需要采用一種特殊的方法創建對象。值得注意的是,根據MSXML解析器的不同版本,需要分別編寫兩種代碼。
var xmlhttp = false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
xmlhttp = false;
文章來源于領測軟件測試網 http://www.kjueaiud.com/