<secipt language="javascript">
var http_request = false;
function send_request(url){ //初始化、指定处理函数,发送请求的函数
http_request = false;
if (window.XMLHttpRequest) { //Mozilla
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) { //设置MiMe类别
http_request.overrideMimeType("text/xml");
}
}
else if (window.ActionXObject) { //IE
try{
http_request = new ActionXObject("Msxml2.XMLHTTP");
}catch (Exception e) {
try{
http_request = new ActionXObject("Microsoft.XMLHTTP");
}catch (e) {}
}
}
if (!http_request) {
window.alert("不能创建XML.HttpRequest实例对象");
return false;
}
http_request.onreadystatechange = processRequest;
http_request.open("GET",url,true);
http_request.send(null);
}
function processsRequest() {
if(http_request.readState ==4){
if(http_request.status == 200){
alart(http_request.responseText);
}elae{
alert("您所请求的页面有异常");
}
}
}
</script>
posted on 2006-05-15 09:25
happytian 阅读(137)
评论(0) 编辑 收藏