You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery-3.4.1.min.js"></script>
<script type="text/javascript">
function reloadCheckImg(){
//alert("hahhhh");
$("img").attr("src","img.jsp?t="+(new Date().getTime()));
}
$(document).ready(function(){
//alert("hahhhh");
$("#checkcodeId").blur(function(){
//alert("hahhhh");
var checkcode=$("#checkcodeId").val();
//校验input输入验证法发送到servlet服务端中的真实值和输入值对比返回结果
$.post(
"CheckCodeServlet",
"checkcode="+checkcode,
function(result){
var resultHtml= $("<img src='"+result+"' height='15' width='15px'/>");
$("#tip").html(resultHtml);
}
);
});
});
</script>
<title>验证码</title>
</head>
<body>
验证码:
<input type="text" name="checkcode" id="checkcodeId" size=4/>
<!-- 验证码 -->
<a href="javascript:reloadCheckImg();"><img src="img.jsp" /></a>
<span id="tip"> </span>
</body>
</html>