验证码缓存问题完美解决方案
2006-08-22 19:29
423 查看
在验证码页面后加一个随机的参数。这样历史记录里就不会有相同的请求了,也就不存在缓存的问题了。
代码如下:
<img id="imgvc" src="ValidateCode.aspx?t='+Math.round(Math.random()*1e17)'" onclick="getObject('imgvc').src='ValidateCode.aspx?t='+Math.round(Math.random()*1e17);" width="66" height="20" align="absmiddle" />
上面的要一个getObject(eleName);函数。。。。用这个就没问题了
<img id="imgvc" src="ValidateCode.aspx?t='+Math.round(Math.random()*1e17)'" onclick="document.getElementById('imgvc').src='ValidateCode.aspx?t='+Math.round(Math.random()*1e17);" width="66" height="20" align="absmiddle" />
代码如下:
<img id="imgvc" src="ValidateCode.aspx?t='+Math.round(Math.random()*1e17)'" onclick="getObject('imgvc').src='ValidateCode.aspx?t='+Math.round(Math.random()*1e17);" width="66" height="20" align="absmiddle" />
上面的要一个getObject(eleName);函数。。。。用这个就没问题了
<img id="imgvc" src="ValidateCode.aspx?t='+Math.round(Math.random()*1e17)'" onclick="document.getElementById('imgvc').src='ValidateCode.aspx?t='+Math.round(Math.random()*1e17);" width="66" height="20" align="absmiddle" />
相关文章推荐
- Android—大图or多图加载解决方案(完美解决OOM问题)
- ajax获取数据中文乱码问题最简单的完美解决方案
- [完美解决]如何在windows安装docker toolbox,使用tensorflow,Jupyter Notebook,各种问题的解决方案
- win2003系统下稻香老农上传问题完美解决方案
- asp.net关于页面不回发的问题,寻求完美解决方案
- js,css,img等浏览器缓存问题解决方案
- 关于模式窗体的缓存问题的解决方案
- ajax获取数据中文乱码问题最简单的完美解决方案
- Mysql中文乱码问题完美解决方案
- Mysql中文乱码问题完美解决方案
- IE下get传中文乱码的问题完美解决方案
- 2015.10.22小结Mysql中文乱码问题完美解决方案(包括建库、导入数据、网页)
- 分布式系统漫谈【拾叁】_缓存带来的问题和解决方案
- DLL导出类避免地狱问题的完美解决方案
- .NET 部署问题之完美解决方案总结(访问IIS元数据库失败,找不到页面,应用程序错误解决)
- 为FC3安装vmware tools问题的完美解决方案--come from vmware.cn' jorin
- C++寫DLL导出类时,避免DLL地狱问题的完美解决方案 (转)
- nginx缓存页面后,串会话问题的解决方案(转)
- Exchange邮箱登陆界面添加验证码功能完美解决方案 推荐
- Mysql中文乱码问题完美解决方案