<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
$().ready(function(){
});
function shuaxin(){
var img =document.getElementById("imageView");
img.src = img.src+"?"+new Date().getTime();
}
<img id="imageView" alt="加载中..." src="${pageContext.request.contextPath}/servlet/Authcode">
<input type="button" onclick="shuaxin()" value="刷新" />
这页面一加载为什么会访问2次 src="${pageContext.request.contextPath}/servlet/Authcode">, ; 当我点击刷新时同样也会访问2次 , 后台servlet就是单纯的验证码生成代码,求各位大神指教啊,很诡异....