Jquery Ajax xml版Get请求PHP
2023-09-11 14:17:23 时间
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title></title>
<style>
</style>
</head>
<body>
<input type="button" value="AJAX提交"/>
<p id="resText"></p>
</body>
<script src="../js/jquery-1.11.3.js"></script>
<script>
$(function(){
$(":input").click(function(){
var xmlHttpReq=null;
if(window.ActiveXObject){
xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlHttpReq=new XMLHttpRequest();
}
xmlHttpReq.open("GET","text.php",true);
function RequestCallback(){
if(xmlHttpReq.readyState==4&&xmlHttpReq.status==200){
document.getElementById('resText').innerHTML=xmlHttpReq.responseText;
console.log(typeof xmlHttpReq.responseText);
}
}
xmlHttpReq.onreadystatechange=RequestCallback;
xmlHttpReq.send(null);
});
})
</script>
</html>
相关文章
- MVC之Ajax.BeginForm使用详解之更新列表 mvc验证jquery.unobtrusive-ajax
- jquery $.proxy使用 Jquery实现ready()的源码
- 【Jquery】jQuery获取URL參数的两种方法
- PHP 中 ini_set() 修改 php 内存限制及检查内存限制方法
- jQuery 全选,反选,取消
- Jquery配合Asp.Net无刷新删除指定服务器上的文件!
- Jquery的LigerUI如何实现文件上传(已解决,有实例)
- jquery on事件jquery on实现绑定多个事件
- jQuery plugin
- jQuery可拖拽排序列表jquery-sortable-lists
- PHP 错误与异常 笔记与总结(3)PHP 配置文件(php.ini)中与错误相关的选项 与 设置错误级别
- PHP+jQuery 长文章分页类 ( 支持 url / ajax 分页方式 )
- PHP+jQuery 注册模块的改进之一:验证码存入SESSION
- 《jQuery与JavaScript入门经典》——2.3 调试CSS
- 《jQuery、jQuery UI及jQuery Mobile技巧与示例》——3.14 技巧:移除元素
- jQuery验证控件jquery.validate.js的使用介绍
- jquery源码
- jquery.params.js,Jquery获取页面参数,js获取页面参数
- Jquery获取html参数, jquery.params.js 获取参数
- 转 php 框架 Php 依赖框架 后台 调用python 脚本
- jquery刷新页面方法
- php的类型运算符instanceof(用于确定一个 PHP 变量是否属于某一类 class 的实例)
- php模板原理PHP模板引擎smarty模板原理浅谈
- PHP之旅——出发(php+apache+MySQL)
- JS魔法堂:jQuery.Deferred(jQuery1.5-2.1)源码剖析
- 16款创建CSS3动画的jQuery插件
- jQuery animate方法开发极客标签Logo动画融合效果
- PHP的mod_rewrite重写模块将.php后缀换成.html
- JQUERY名称冲突
- jQuery选择器整理
- linux下无法执行PHP命令,错误 php: command not found
- PHP PHPStorm 解决运行报错 502 Bad Gateway,配置PHP Interpreter,配置php.exe