Ajax通用模板实现代码
更新时间:2011年12月19日 23:46:06 作者:
Ajax通用模板实现代码,需要的朋友可以参考下。
复制代码 代码如下:
<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 serialize() 表单进行序列化方式上传文件
这篇文章主要介绍了Ajax serialize() 表单进行序列化方式上传文件的相关资料,需要的朋友可以参考下2017-04-04使用Ajax或Easyui等框架时的Json-lib的处理方案
这篇文章主要介绍了使用ajax或easyui等框架时的Json-lib的处理方案 ,需要的朋友可以参考下2017-06-06
最新评论