Verification code in IE does not refresh while Google and other browsers normal solution _javascript skills

Source: Internet
Author: User
Today in the verification code found in IE, the verification code will not be refreshed, and Google and other browsers do not have problems, so I think it should be a cache problem, because the IE default setting is that if the access address does not change will not go to get the contents of the load cache

So the solution is to add a random parameter after the switching address of the verification code.

For example:
Copy Code code as follows:

<script>
Change authentication Code
function changeimg () {
/*
Math.random Range is 0-1.
*999 into 0-999.
+3000 is 3000-3999.
*/
var time=math.round (Math.random () *999) +3000;
$ (' #captcha '). attr (' src ', ' __app__/public/verify/time/' +time);
}
</script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.