TP experts help me see, the verification code cannot be refreshed ,. Is there a problem with JS?

Source: Internet
Author: User
TP experts help me see, the verification code cannot be refreshed ,. Is there a problem with JS?
Script // var captcha_img generated by the verification code =$ ('# captcha-INER '). find ('IMG ') var verifyimg = captcha_img.attr ("src"); captcha_img.attr ('title', 'Click refresh'); captcha_img.click (function () {if (verifyimg. indexOf ('? ')> 0) {$ (this ). attr ("src", verifyimg + '& random =' + Math. random ();} else {$ (this ). attr ("src", verifyimg. replace (/\?. * $/, '') + '? '+ Math. random () ;}}); script


 

Verification code:


Reply to discussion (solution)

First, make sure that the address Home/Index/verify_c can be refreshed and changed to a verification code.

Second, will your address be automatically assigned? Random = 2 to/random/2.


I didn't see the onclick code of the img click event. will TP be generated for you?
Please check in the source code of the browser page

First, check whether the loaded URL can generate a verification code normally. then, check whether the js code can properly load the click event by img. Finally, click to refresh.

First, use firebug to check if any js error is reported, and then track it in the click event step by alert ('test ').

Solved. thank you.

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.