thinkphp learn to use-verification code accidentally made a mistake

Source: Internet
Author: User

Look at the code first:

1 $ (". Verify_img"). Click (function() {2         varnew  Date ( ). GetTime (); 3         var url = "{: U (' index/loginverify ')}&t=" +TimeNow; 4         alert (URL); 5         $ (this). attr ("src", url)6     });

The above code causes the verification code click Switch causes the CAPTCHA picture to be unable to display.

Then look at the following code:

$ (". Reloadverify"). Click (function() {     varnew  Date (). GetTime ();         var url = "{: U (' index/loginverify ')}?t=" +TimeNow;       $ ("#image_d"). attr ("src", url)     });

What is the area of the above code? and the difference between &. After comparison, you can see where the problem lies. It is also valid to follow a random number directly after the question mark. var url = "{: U (' index/loginverify ')}?" +math.random ();

It is clear that the problem is here.

thinkphp learn to use-verification code accidentally made a mistake

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.