<script type="text/javascript">
var xmlHttp = null; function GetLocations() {
response = null;
if(!xmlHttp) InitxmlHttp();
xmlHttp.open('GET','stateList.htm',false);//用GET方法来发送一个HTTP请求,判断是否异步请求
xmlHttp.send(null); var Content = xmlHttp.responseText; //将响应信息作为字符串返回.只读
var locations = document.getElementById('Locations');
if(Content && locations)
locations.innerHTML = Content;
} function InitxmlHttp() {//初始化xmlHttp
try {
xmlHttp = new XMLHttpRequest(); //创建XMLHTTPRequest的一个实例(本地javascript对象),FireFox,Safari把它当做本地对象
return;
}
catch (ex) { }
try {
xmlHttp = new ActiveXObject("Msxm12.XMLHTTP.4.0"); //通过实例化ActiveXObject的一个新实例来创建XMLHTTPRequest对象, IE将它当做一个ACTIVE对象
return;
}
catch (ex) { }
try {
xmlHttp = new ActiveXObject("Msxm12.xmlhttp");
return;
}
catch (ex) { }
xmlHttp = null; } </script>这个程序里reponse=null是什么意思?
var xmlHttp = null; function GetLocations() {
response = null;
if(!xmlHttp) InitxmlHttp();
xmlHttp.open('GET','stateList.htm',false);//用GET方法来发送一个HTTP请求,判断是否异步请求
xmlHttp.send(null); var Content = xmlHttp.responseText; //将响应信息作为字符串返回.只读
var locations = document.getElementById('Locations');
if(Content && locations)
locations.innerHTML = Content;
} function InitxmlHttp() {//初始化xmlHttp
try {
xmlHttp = new XMLHttpRequest(); //创建XMLHTTPRequest的一个实例(本地javascript对象),FireFox,Safari把它当做本地对象
return;
}
catch (ex) { }
try {
xmlHttp = new ActiveXObject("Msxm12.XMLHTTP.4.0"); //通过实例化ActiveXObject的一个新实例来创建XMLHTTPRequest对象, IE将它当做一个ACTIVE对象
return;
}
catch (ex) { }
try {
xmlHttp = new ActiveXObject("Msxm12.xmlhttp");
return;
}
catch (ex) { }
xmlHttp = null; } </script>这个程序里reponse=null是什么意思?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货