没有合适的资源?快使用搜索试试~ 我知道了~
转自他人的jsp+ajax
资源推荐
资源详情
资源评论
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD>
<TITLE>留学生系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GBK">
<SCRIPT language=JavaScript type=text/JavaScript>
var XMLHttpReq = false;
function createXMLHttpRequest(){
if(window.XMLHttpRequest){
XMLHttpReq = new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
XMLHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
}catch(e){
try{
XMLHttpReq = new ActiveXObject("Mircsoft.XMLHTTP");
}catch(e1){}
}
}
}
function sendRequest(url){
createXMLHttpRequest();
XMLHttpReq.open("GET",url,true);
XMLHttpReq.onreadystatechange = processResponse;
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD>
<TITLE>留学生系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GBK">
<SCRIPT language=JavaScript type=text/JavaScript>
var XMLHttpReq = false;
function createXMLHttpRequest(){
if(window.XMLHttpRequest){
XMLHttpReq = new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
XMLHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
}catch(e){
try{
XMLHttpReq = new ActiveXObject("Mircsoft.XMLHTTP");
}catch(e1){}
}
}
}
function sendRequest(url){
createXMLHttpRequest();
XMLHttpReq.open("GET",url,true);
XMLHttpReq.onreadystatechange = processResponse;
XMLHttpReq.send(null);
}
function processResponse(){
if(XMLHttpReq.readyState == 4){
if(XMLHttpReq.status == 200){
var res = XMLHttpReq.responseXML.getElementsByTagName("res")[0].firstChild.data;
window.alert(res);
document.myform.userid.value="";
document.myform.pwd.value="";
}else{
window.alert("你请求的页面有异常1");
}
}
}
function userCheck(){
var userid = document.myform.userid.value;
var pwd = document.myform.pwd.value;
if(userid == ""){
window.alert("用户名不能为空");
document.myform.pwd.value="";
document.myform.userid.focus();
return false;
}else{
sendRequest("login?userid="+userid);
}
}
function pwdCheck(){
var pwd = document.myform.pwd.value;
var pwd2 = document.myform.pwd2.value;
}
function processResponse(){
if(XMLHttpReq.readyState == 4){
if(XMLHttpReq.status == 200){
var res = XMLHttpReq.responseXML.getElementsByTagName("res")[0].firstChild.data;
window.alert(res);
document.myform.userid.value="";
document.myform.pwd.value="";
}else{
window.alert("你请求的页面有异常1");
}
}
}
function userCheck(){
var userid = document.myform.userid.value;
var pwd = document.myform.pwd.value;
if(userid == ""){
window.alert("用户名不能为空");
document.myform.pwd.value="";
document.myform.userid.focus();
return false;
}else{
sendRequest("login?userid="+userid);
}
}
function pwdCheck(){
var pwd = document.myform.pwd.value;
var pwd2 = document.myform.pwd2.value;
剩余8页未读,继续阅读
资源评论
aisanyiyi
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功