您的位置:首页 > 理论基础 > 计算机网络

XMLHTTPRequest对象构造函数(常用)

2009-01-05 10:53 295 查看
<script language="javascript" type="text/javascript">

var request;

function createRequest() {

try {

request = new XMLHttpRequest();

} catch (trymicrosoft) {

try {

request = new ActiveXObject("Msxml2.XMLHTTP");

} catch (othermicrosoft) {

try {

request = new ActiveXObject("Microsoft.XMLHTTP");

} catch (failed) {

request = false;

}

}

}

if (!request)

alert("Error initializing XMLHttpRequest!");

}

function getCustomerInfo() {

createRequest();

// Do something with the request variable

}

</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: