日期:2014-05-17  浏览次数:20750 次

freemarker页面实现验证码图片不刷新问题 求助
小弟想实现个验证码功能
页面代码
<img id="loginWindowCaptchaImage" alt="换一张" src="${base}/template/inc/images/securityCode.jpg?temp=${currentTimeMillis!}"></img>
效果是每次刷新图片后
src="/csSystem/template/inc/images/securityCode.jpg?temp=1357542662578"
src="/csSystem/template/inc/images/securityCode.jpg?temp=1357542656274"
src="/csSystem/template/inc/images/securityCode.jpg?temp=1357512345578"
src里面的地址都是变了的
本地图片也变了
但是页面显示的图片就是不变
求大虾帮助
IE 火狐 谷歌都不行
验证码?img?src?属性

------解决方案--------------------
看下请求出去了没?难道服务器那边没有新生成图片?
------解决方案--------------------
securityCode.jpg本身变化了吗?
一般情况下使用程序实现的如
<img alt="换一张" src="${base}/template/inc/images/securityCode" onclick="this.src='${base}/template/inc/images/securityCode?tmp' + (new Date()).valueOf()"></img>