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>
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>
相关文章推荐
- XMLHttpRequest对象的常用方法
- Ajax XMLHttpRequest对象的常用属性
- XMLHttpRequest对象的常用属性
- ajax 快速入门,ajax底层使用的五个步骤;XMLHttpRequest对象详解;XMLHttpRequest常用属性;XMLHttpRequest常用方法
- AJAX笔记一创建XMLHttpRequest对象,以及XMLHttpRequest对象的常用属性
- ajax====xmlHttpRequest对象的常用属性和方法
- Ajax对象XMLHttpRequest的常用属性,方法和事件
- XMLHttpRequest对象的几种状态和几个重要属性以及常用的方法
- XMLHttpRequest对象的常用方法和属性(相当重要!!!)
- XMLHttpRequest对象的常用属性与方法
- 常用的XmlHttpRequest对象属性
- XMLHttpRequest对象属性及常用方法
- XMLHttpRequest对象的常用属性
- 全面剖析XMLHttpRequest对象(转)
- XMLHttpRequest对象概述
- XMLHttpRequest 对象
- Ajax中的XMLHttpRequest对象详解
- 【技术】javascript XMLHttpRequest对象全面剖析
- 【转载并整理】AJAX XmlHttpRequest对象详解
- XMLHttpRequest 对象简介