首页 > 语言 > JavaScript > 正文

javaScript如何生成xmlhttp

2024-05-06 14:31:51
字体:
来源:转载
供稿:网友
代码如下:
function ajaxFunction(){
var xmlHttp;
try { // Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e) {
try {// Internet Explorer
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
}
}
}

return xmlHttp;
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选