大jsp包含小jsp,使用jquery实现对小jsp(返回的是四个数字验证码)刷新

陈茂
2023-12-01
<%@page import="com.sun.java.swing.plaf.windows.resources.windows"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/inc/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/lostandfound.css"/>
<script src="${ctx}/static/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${ctx}/static/js/jquery-migrate-1.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${ctx}/static/js/jquery-easyui-1.3.6/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<title>失物招领</title>
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/green.css"/>
<script type="text/javascript" src="${ctx}/static/js/jquery-1.7.2.min.js"></script>
<script language="javascript" src="${ctx}/static/js/jquery.Sonline.js"></script>
<script type="text/javascript">
$(function(){
$("body").Sonline({
Position:"right",//left或right
Top:200,//顶部距离,默认200px
Effect:true, //滚动或者固定两种方式,布尔值:true或false
DefaultsOpen:true, //默认展开:true,默认收缩:false
Qqlist:"512760583|客服01,1559117137|客服02,1941344942|客服03,431438262|客服04" //多个QQ用','隔开,QQ和客服名用'|'隔开
});

$("#pic").click(function(){
$("#pic").attr("src","image.jsp?id="+Math.random());
});
})
   
</script>
<%  Object error = request.getSession().getAttribute("error");
if(error != null){
  out.println("<script>alert('验证码输入不正确,请重新输入!');</script>");
}
request.getSession().removeAttribute("error");
 %>
</head>
<body class="lost">
<div class="losttop">第一步:发布失物招领</div>
<div class="lostmain">
<form class="lostform" method="post" id="form" name="form" action="http://localhost:8080/equip/lost" >
标题:<input class="title" name="title" id="title" type="text" value="${lost.title }"><br>
<a class="prompt">深圳市:在龙岗区爱联地铁站拾到一把红包雨伞(示范标题)</a><br>
发布者:<input class="announcer" name="announcer" id="announcer" type="text" value="${lost.announcer }" ><br>
物品种类:<select class="type" name="type" id="type">
<option id="type1">证件</option>
<option id="type2">钱包</option>
<option id="type3">卡类</option>
<option id="type4">其他</option>
</select><br>
拾物地点:<select class="lostadress" name="lostadress" id="lostadress" >
<option id="lostadress1">北京</option>
<option id="lostadress2">上海</option>
<option id="lostadress3">广州</option>
<option id="lostadress4">深圳</option>
</select><br>
详细地址:<input class="adress" name="adress" id="adress" type="text" value="${lost.adress }" ><br>
联系人:<input class="contacts" name="contacts" id="contacts" type="text" value="${lost.contacts }" ><br>
联系电话:<input class="phone" name="phone" id="phone" type="text" value="${lost.phone }" ><br>
失物时间:<input class="losttime" name="losttime" id="losttime" type="text" value="${lost.losttime }" ><br>
详细内容:<input class="details" name="details" id="details" type="text" value="${lost.details }" ><br>
<div class="VerificationCode">请输入验证码:<input type="text" name="code" id="code"/>
<img src="image.jsp" id="pic" name="pic"/></div>   
<input class="submit" name="submit" id="submit" type="submit" value="提交" >
<input class="button" name="button" id="button" type="reset" value="重置"><br>
</form>
</div>
</body>
</html>
 类似资料: