-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
48 lines (41 loc) · 1.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Google reCAPTCHA v2 Test</title>
</head>
<body>
<h1>Google reCAPTCHA v2 Test</h1>
<p>
Check out the <a href="https://github.com/richrdkng/recaptcha-v2-test">README</a> for usage.
</p>
<div
class="g-recaptcha"
data-sitekey="6LdMZVYeAAAAAMllhCkGfP2PIiTdzfyQCdsK45Gl"
data-callback="onCaptchaSuccess"
data-expired-callback="onCaptchaExpired"
data-error-callback="onCaptchaError"
></div>
<script>
// 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')
}
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onCaptchaLoad" async defer></script>
</body>
</html>