原文主要内容来自
https://blog.csdn.net/ntt126796/article/details/51005875
在jsp页面中使用
<%@ page language="java" pageEncoding="GBK"%>
<html>
<head>
<title>JSP for LoginForm form</title>
<script type='text/javascript' src='dwr/interface/JUserChecker.js'></script>
<script type='text/javascript' src='dwr/engine.js'></script>
<script type='text/javascript' src='dwr/util.js'></script>
<script>
function checkU(oCtl){
var uname=oCtl.value;
JUserChecker.check(uname,haolejiaowo);
}
function haolejiaowo(isExist){
if(isExist==1){
alert("hao");
}
else if(isExist==0){
alert("error");
}
}
</script>
</head>
<body>
<form action="" name="form1">
<input name="uname" onblur="checkU(this)">
</form>
</body>
</html>