Thinkphp learn and use the verification code-mistakes accidentally made _ PHP Tutorial

Source: Internet
Author: User
Thinkphp learns and uses the verification code to inadvertently make a mistake. Thinkphp learns and uses the verification code. the error code is 1 $ (. verify_img ). click (function () {2 vartimenownewDate (). getTime (); 3 varurl {: U (indexloginverify)} t + time Thinkphp learn and use the-verification code to accidentally make a mistake

First look at the code:

1 $ (". verify_img"). click (function (){

2 var timenow = new 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 to fail to be displayed due to click switching.

Let's look at the following code:

$ (". Reloadverify"). click (function (){

Var timenow = new Date (). getTime ();

Var url = "{: U ('index/loginVerify ')}? T = "+ timenow;

$ ("# Image_d"). attr ("src", url)

});

What is the region of the above code? And. After comparison, we can see where the problem is. It is also valid to keep up with a random number after the question mark. Var url = "{: U ('index/loginVerify ')}? "+ Math. random ();

It is clear to write the question here.

Http://www.bkjia.com/PHPjc/890646.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/890646.htmlTechArticleThinkphp while learning with-verification code inadvertently made the error first look at the code: 1 $ (. verify_img ). click (function () {2 var timenow = new Date (). getTime (); 3 var url = {: U (index/loginverify)} t = + time...

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.