首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jQuery惯用方法及实例

2012-11-17 
jQuery常用方法及实例一、验证用户是否存在$(document).ready(function(){?$(#groupNameId).blur(functio

jQuery常用方法及实例

一、验证用户是否存在

$(document).ready(function(){
?$("#groupNameId").blur(function(event){
??
?????? $.ajax({
?????????? type:"POST",
?????????? url:"<%=request.getContextPath() %>/cefServerGroupAction.do",
?????????? dataType:"html",
?????????? data:"groupName="+$(".groupNameId").val(),
?????????? cache:false,
?????????? async:true,
?????????? beforeSend:function(XMLHttpRequest)
?????????????? {
?????????????????? $("#showResult").text("正在查询");
?????????????????? //Pause(this,100000);
?????????????? },
?????????? success:function(msg)
?????????????? {??
?????????????????? $("#showResult").html(msg);
?????????????????? $("#showResult").css("color","red");
?????????????? },
????????? complete:function(XMLHttpRequest,textStatus)
?????????????? {
?????????????????? //隐藏正在查询图片
?????????????? },
???????? error:function()
????????????? {
?????????????????? //错误处理
?????????????????? var msg = "组名已经存在,请更换一个名字!";
??????????? ?? $("#showResult").html(msg);
????????????????? $("#showResult").css("color","red");
????????????????? $("#groupNameId").focus();
????????????????? event.preventDefault();
????????????? }
?????????? });

??????
???? });
?? });

?

?

?mvn -Dmaven.test.skip=true clean package

?

?

二、

?

热点排行