Ajax通用模板实现代码
2018-10-12 13:57
489 查看
<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通用模板实现代码
- Android社交类APP动态详情代码实现通用模板
- Android社交类APP动态详情代码实现通用模板
- C++模板实现的通用工厂方法模式
- C# 配合 Easyui DataGrid 实现增删改查 通用模板
- 爬虫代码实现二:抽取网站规则模板,优化解析代码(1)
- asp.net+ajaxfileupload.js 实现文件异步上传代码分享
- ajax提交代码模板
- jQuery基于ajax实现带动画效果无刷新柱状图投票代码
- 为什么C++编译器不支持模板头文件和实现代码分离的编译
- 7、实现通用分页功能三(实现通用分页JSP代码)
- ThinkPHP结合ajax、Mysql实现的客户端通信功能代码示例
- nc7下某个用户某个节点有多个模板,可以通过代码实现通过选择不同的业务流程来调用不同的模板吗?
- AJAX调用页面后台代码方法实现下拉框二级联动效果
- 实现医生工作站的处方模板功能的代码(十一)
- ajax传递多个参数的实现代码
- BaseItemLayout一行代码实现一些通用的 Item 布局
- AJAX和三层架构实现分页功能具体思路及代码
- Ajax+Json 级联菜单实现代码