JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 169
  • Score
    100M100P100Q75432F

BotDetect Captcha jQuery Plugin (BotDetect Captcha Simple API integration for all of the jQuery versions)

Package Exports

  • jquery-captcha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jquery-captcha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

BotDetect Captcha jQuery Plugin (BotDetect Captcha Simple API integration for all of the jQuery versions)

Quick guide:

1) Captcha jQuery Plugin Installation
npm install jquery-captcha --save
2) Include Captcha jQuery Plugin in Your Web App
<script src="node_modules/jquery-captcha/dist/jquery-captcha.min.js"></script>
3) Load Captcha jQuery Plugin in Your App
  • Java Captcha endpoint:
$(document).ready(function() {
    // DOM ready
    var captcha = $('#botdetect-captcha').captcha({
      captchaEndpoint: '/botdetect-java-captcha-api-path-at-server-side/botdetectcaptcha'
    });
});
  • PHP Captcha endpoint:
$(document).ready(function() {
    // DOM ready
    var captcha = $('#botdetect-captcha').captcha({
      captchaEndpoint: '/botdetect-php-captcha-api-path-at-server-side/simple-botdetect.php'
    });
});
4) Display Captcha In Your View
<div id="botdetect-captcha" data-stylename="exampleCaptcha"></div>
5) Validate Captcha on the Client-side
$('#captchaCode').on('validatecaptcha', function(event, isCorrect) {
  if (isCorrect) {
    // UI Captcha validation passed
  } else {
    // UI Captcha validation failed
  }
});
6) Validate Captcha on the Server-side

The client-side Captcha validation is just a usability improvement. Captcha protects some action on a server-side, and therefore Captcha validation has to be there as well.

  • Server-side Captcha validation with Java Captcha looks in this way:
SimpleCaptcha captcha = SimpleCaptcha.load(request);
boolean isHuman = captcha.validate(captchaCode, captchaId);
  • Server-side Captcha validation with PHP Captcha looks in this way:
$captcha = new SimpleCaptcha();
$isHuman = $captcha->Validate($captchaCode, $captchaId);

Docs:

jQuery CAPTCHA Integration Guide

Code Examples:

  1. Basic jQuery CAPTCHA Example

  2. jQuery CAPTCHA Form Example

Dependencies:

Captcha jQuery plugin uses Captcha library for Captcha image and Captcha sound generation. At the moment challenges are generated in Java backend with BotDetect Java Captcha library and PHP backend with BotDetect PHP Captcha library, but BotDetect ASP.NET is going to work with Captcha jQuery plugin soon as well.

Technical Support:

Through contact form on captcha.com.