在浏览器后退按钮上重新加载验证码 [英] Reload recaptcha on browser back button

查看:237
本文介绍了在浏览器后退按钮上重新加载验证码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了无数方法来在分页时重新加载图像,但是无论我尝试什么,我都会得到相同的图像.有些方法已经关闭(我可以看到图像刷新,但是Recaptcha服务器会响应并重新出现以前的图像).单击后退按钮时,是否有一些技巧可以重新加载图像?我不希望用户输入错误的安全字来重新输入所有表单信息.我也想避免存储所有信息.该页面是经典的ASP,因此可以使用jquery或ajax方法,或者以id来假设.预先感谢.

I have tried numerous methods to reload the image when paging back but no matter what i try i get the same image. Some methods were close ( i can see the image refresh, but the recaptcha server responds back and the previous image reappears). Is there some trick to getting the image to reload when clicking the back button? I dont want my users to have to re-enter all the form information if they type the security words incorrectly. I also want to avoid storing all the information. The page is classic asp, so jquery or ajax methods would be the route to go, or so id assume. Thanks in advance.

推荐答案

我找到了解决此问题的快速技巧.在带有Recaptcha的页面上,添加以下jquery

I figured out a quick hack that fixes this issue. On the page with the recaptcha add the following jquery

<script>
$(document).ready(function(){
  $("#form_div").Show();
);
</script>

只需将"#form_div"替换为包含表格的div.现在,当用户单击后退"按钮时,它将刷新重新设置图像.从各个方面讲,这都是一种技巧,但对我有用.

Just replace "#form_div" with whatever div houses your form. Now when the user hits the back button it refreshes the recaptcha image. It is a hack in every sense of the word, but it worked for me.

这篇关于在浏览器后退按钮上重新加载验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆