ajax的登录处理
来源:互联网 发布:qt 调用dotnet 编程 编辑:程序博客网 时间:2024/06/05 04:08
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
</style>
</head>
<body>
用户名:<input type="text" name="username">
密码: <input type="password" name="password">
<button>提交</button>
</div>
</body>
<script type="text/javascript">
var userInp=document.getElementsByTagName('input')[0];
var passInp=document.getElementsByTagName('input')[1];
var btn=document.getElementsByTagName('button')[0];
//绑定事件
btn.onclick=function(){
var ajax=new XMLHttpRequest();
ajax.onload=function(){
var data=ajax.responseText;
alert(data);
}
ajax.open('POST','http://localhost/AJAX/php/log.php',true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send('username='+userInp.value+'&password='+passInp.value);
}
</script>
</html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
</style>
</head>
<body>
用户名:<input type="text" name="username">
密码: <input type="password" name="password">
<button>提交</button>
</div>
</body>
<script type="text/javascript">
var userInp=document.getElementsByTagName('input')[0];
var passInp=document.getElementsByTagName('input')[1];
var btn=document.getElementsByTagName('button')[0];
//绑定事件
btn.onclick=function(){
var ajax=new XMLHttpRequest();
ajax.onload=function(){
var data=ajax.responseText;
alert(data);
}
ajax.open('POST','http://localhost/AJAX/php/log.php',true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send('username='+userInp.value+'&password='+passInp.value);
}
</script>
</html>
阅读全文
0 0
- ajax的登录处理
- 在Acegi认证框架下的ajax异步登录处理
- 在Ajax请求中处理登录session超时的方法
- 关于shiro中 ajax请求登录失效的处理
- ajax的登录
- 单点登录,session超时, ajax链接处理
- 利用AJAX实现简单的用户登录程序(处理服务端返回的文本数据)
- Spring Security管理下的ajax请求登录超时问题处理
- Struts2 在登录拦截器中对ajax请求的处理
- ajax session失效后,跳转到登录页面的全局处理
- 登录模块的处理
- 一个简单的Ajax登录
- ajax的缓存处理
- AJAX数据的处理
- ajax的处理流程
- JQuery的ajax处理
- 处理ajax的响应
- struts2的ajax处理
- 342. Power of Four
- Koa2 —(2)
- SSM框架搭建
- 应用启动时间统计方法
- surfacetexture与camera结合基本流程
- ajax的登录处理
- Android RecyclerView (十)组件化封装
- 去掉AlertDialog边框的方法
- 项目中使用Shiro出现空指针异常的问题
- 编辑图片时,能够实时显示上传的图片(预览)
- jsp中的cookie与session的区别
- Java集合框架之Map---HashMap和LinkedHashMap源码分析
- matlab 二分法
- 枚举的定义和使用