AJAX异步验证密码
$(function() { $("#usercode").blur(function () { var pwd = $(this).val(); var Y = "<img src='http://localhost:8080/dome_war/images/y.png' width='18px' height='18'>"; var X = "<img src='http://localhost:8080/dome_war/images/n.png' width='18px' height='18px'>用户名已存在"; $.post("http://localhost:8080/dome_war/uppwd.du", {"userid": "adduserajax", "usercode": pwd}, function (result) { if (result.oldpwd == 0) { $("#usercode").next().html(Y); $("#a1").val(1); } if (result.oldpwd == 1) { $("#usercode").next().html(X); $("#a1").val(0); } }, "json"); })