Skip to content

A simple website to test basic reCAPTCHA v2 functionality with callbacks.

License

Notifications You must be signed in to change notification settings

richrdkng/recaptcha-v2-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Google reCAPTCHA v2 Test

A simple website to test basic reCAPTCHA v2 functionality with callbacks.

☕ Usage

To handle possible reCAPTCHA v2 events, override one or more of the following in index.html:

// fired, when the reCAPTCHA is loaded (onload URL parameter)
function onCaptchaLoad() {
    console.log('onCaptchaLoad')
}
// fired, when the user submits a successful reCAPTCHA response (data-callback attribute)
function onCaptchaSuccess(token) {
    console.log('onCaptchaSuccess', token)
}
// fired, when the reCAPTCHA response expires and the user needs to re-verify (data-expired-callback attribute)
function onCaptchaExpired() {
    console.log('onCaptchaExpired')
}
// fired, when the reCAPTCHA encounters an error (data-error-callback attribute)
function onCaptchaError() {
    console.log('onCaptchaError')
}

🍻 Contribution

Any contribution is highly appreciated. Thank you in advance and have fun!

©️ License

MIT @ Richard King