手机
当前位置:查字典教程网 >编程开发 >AJAX相关 >Ajax通用模板实现代码
Ajax通用模板实现代码
摘要:复制代码代码如下:varxmlHttp;functioncreatXMLHttpRequest(){if(window.ActiveXObj...

复制代码 代码如下:

<script type="text/javascript">

var xmlHttp;

function creatXMLHttpRequest() {

if (window.ActiveXObject) {

xmlHttp = new ActiveXObject("Microsoft.XMLHttp");

}

else if (window.XMLHttpRequest) {

xmlHttp = new XMLHttpRequest();

}

}

function startRequest() {

creatXMLHttpRequest();

xmlHttp.onreadystatechange = handleStateChange;

xmlHttp.open("GET", "simpleResponse.xml", true);

xmlHttp.send(null);

}

function handleStateChange() {

if (xmlHttp.readyState == 4) {

if (xmlHttp.status == 200) {

// document.getElementById("results").innerHTML = xmlHttp.responseText;

// alert("The server replied with:" + xmlHttp.responseText);

}

}

}

</script>

【Ajax通用模板实现代码】相关文章:

asp.net+Ajax 文本文件静态分页实现代码

Ajax 返回字符串的过滤实现代码

ajax实现标签导航

用实现ajax读博客rss示例代码

利用H5特性FormData实现不刷新文件上传

用AJAX实现的无刷新的分页实现代码(asp.net)

AJAX 二级级联菜单实现代码

Ajax初试之读取数据篇实现代码

Ajax中的循环方案

javascript Ajax 类实现代码

精品推荐
分类导航