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...