求 无跳转验证用户名在数据库中是否存在. JSP的,谢谢

xyingwd 2008-04-25 03:27:27
如提,
有高手能提供一些XMLHTTP协议的简单代码,或者初学资料吗?感激不尽!!
...全文
83 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
phyeas 2008-04-25
  • 打赏
  • 举报
回复
// JavaScript Document
var http_request=null;
function getRequest(){//作为获取XMLHttpRequest的函数
var request=null;//定义
if(window.XMLHttpRequest){//如果浏览器是Mozilla
request=new XMLHttpRequest();//初始化对象
if(request.overrideMimeType){
request.overrideMimeType("text/html");//设置mime类型
}
}else if(window.ActiveXObject){//如果是IE浏览器
try{
request=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
request=new ActiveXObject("Mrcisoft.XMLHTTP");
}
}
if(!request){//如果对象为空.表示有异常,对象没能创建出来
alert("创建XmlRequest对象失败");
return false;
}else{
return request;
}
}
//发送请求并指定处理函数
function sendRequest(url){
//alert(url);
http_request=getRequest();
if(http_request){
http_request.onreadystatechange=processRequest;//回调函数processRequest
http_request.open("GET",url,true);
http_request.send(null);
}
}



hyxd2 2008-04-25
  • 打赏
  • 举报
回复
ajax很简单实现
jayflee 2008-04-25
  • 打赏
  • 举报
回复
ajax
xyingwd 2008-04-25
  • 打赏
  • 举报
回复
XMLHTTP协议可以实现不跳转页面获取服务器返回信息,
希望知道的高手能给点信息
xzy_ysx 2008-04-25
  • 打赏
  • 举报
回复
用Ajax 可以google一下,很多资料
yami251139 2008-04-25
  • 打赏
  • 举报
回复
没听明白。。。
你想不经过数据库直接验证用户名是否存在?
那怎么 验证啊。。。
除非你把用户名全部写到配置文件里面
不过那样很死,而且不容易维护,更新烦。。。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧