Why is Asynchrony used?

Source: Internet
Author: User

1. Silly refresh
The so-called silly refresh is to add a hyperlink directly behind the verification code image. The hyperlink address is still on this page. The advantage is: the simplest way is to know at first glance.

No technical content. But not enough: refresh is equivalent to refreshing the entire page, which is the same as clicking the browser to refresh, And will clear the information you enter in the form.
The following two refresh methods will not clear the form information, which is a little troublesome. The third method is to refresh the common verification code on the webpage.

2. Click the verification code image to refresh

<Script type = "text/javascript">
Function change (img ){
Img. src = img. src + "? "+ New Date (). getTime ();
}
</Script>

<Input type = "text" name = "checkcode">
& Nbsp;
(you can't see clearly, click the verification code)

 

3. Click connection refresh next to the Verification Code

<Script type = "text/javascript">
Function change (){
Document. getElementById ("img"). src = "CheckCode? "+ Math. random ();
}
</Script>

<Input type = "text" name = "checkcode"> & nbsp;
& nbsp;
<A href = "javascript: change ();"> cannot see clearly. Click here </a> <br>

Explanation: src = "CheckCode? "+ Math. random (); the question mark next to this path is a random number, which has been refreshed. Img

Src = "CheckCode". Here, the CheckCode is the verification code class, and the above js script refreshes the code by obtaining the id. Therefore, the id here must exist and must not be omitted.

Of

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.