Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use jQuery+Ajax to determine whether the input CAPTCHA is correct

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "how to use jQuery+Ajax to determine whether the input CAPTCHA is correct", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use jQuery+Ajax to determine whether the input CAPTCHA is correct" article.

The specific code is as follows:

$(document) .ready (function (e) {$('# yes'). Hide (); $('# no'). Hide ()) .keyup (function () {if ($(this). Val (). Length = = 4) {$.post ('gbook.php', {cc:$ (' input [name = gcode]'). Val ()}, function (msg) {if (msg=='yes') {$('# no'). Hide () $('# yes'). Show ();} else {$('# yes') .hide (); $("# no") .show ();}});});})

First, jquery is introduced.

.sl-error-verifycode {background-image: url ("images/icons.png"); background-position:-26px 0; background-repeat: no-repeat; display: block; font-size: 18px; height: 23px; line-height: 20px; margin-left: 180px; margin-top:-25px; position: relative; text-align: center; width: 20px; z-index: 2;} .sl-correct-verifycode {background-image: url ("images/icons.png"); background-position:-50px 0 Background-repeat: no-repeat; display: block; font-size: 18px; height: 23px; line-height: 20px; margin-left: 180px; margin-top:-25px; position: relative; text-align: center; width: 20px; z-index: 2;}

Html code of the CAPTCHA

CAPTCHA: *

Gbook.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report