复制代码代码如下 :
fonction ajaxFonction(){
var xmlHttp;
essayez { // Firefox, Opera 8.0+, Safari
xmlHttp = nouveau XMLHttpRequest();
}
attraper (e) {
essayez {//Internet Explorer
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
attraper (e) {
essayer {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
attraper (e) {
}
}
}
retourner xmlHttp ;
}