|
1 | 1 | <html>
|
2 |
| - <head> |
3 |
| - <link href="//cdn.muicss.com/mui-0.10.3/css/mui.min.css" rel="stylesheet" type="text/css" /> |
4 |
| - <title>Procaptcha demo: Simple page</title> |
5 |
| - <script src="procaptcha.bundle.js" async defer></script> |
6 |
| - </head> |
7 |
| - <body> |
8 |
| - <div class="mui-container"> |
9 |
| - <form action="?" class="mui-form"> |
10 |
| - <legend>Login</legend> |
11 |
| - <div class="mui-textfield mui-textfield--float-label"> |
12 |
| - <label>Email Address</label> |
13 |
| - <input type="email" required /> |
14 |
| - </div> |
15 |
| - <div class="mui-textfield mui-textfield--float-label"> |
16 |
| - <label>Password</label> |
17 |
| - <input type="password" required /> |
18 |
| - </div> |
19 |
| - <div id="procaptcha-container"></div> |
20 |
| - <!-- Dev sitekey --> |
21 |
| - <div |
22 |
| - class="procaptcha" |
23 |
| - data-theme="dark" |
24 |
| - data-sitekey="5HUBceb4Du6dvMA9BiwN5VzUrzUsX9Zp7z7nSR2cC1TCv5jg" |
25 |
| - ></div> |
26 |
| - <input type="submit" class="mui-btn mui-btn--raised" /> |
27 |
| - </form> |
| 2 | +<head> |
| 3 | + <link href="//cdn.muicss.com/mui-0.10.3/css/mui.min.css" rel="stylesheet" type="text/css"/> |
| 4 | + <title>Procaptcha demo: Simple page</title> |
| 5 | + <script id="procaptchaScript" src="procaptcha.bundle.js" async defer></script> |
| 6 | +</head> |
| 7 | +<body> |
| 8 | +<div class="mui-container"> |
| 9 | + <form action="?" class="mui-form"> |
| 10 | + <legend>Login</legend> |
| 11 | + <div class="mui-textfield mui-textfield--float-label"> |
| 12 | + <label>Email Address</label> |
| 13 | + <input type="email" required/> |
28 | 14 | </div>
|
29 |
| - <script> |
30 |
| - // Define a callback function to be called when the CAPTCHA is verified |
31 |
| - window.onCaptchaVerified = function (output) { |
32 |
| - console.log('Captcha verified, output: ' + JSON.stringify(output)) |
33 |
| - } |
| 15 | + <div class="mui-textfield mui-textfield--float-label"> |
| 16 | + <label>Password</label> |
| 17 | + <input type="password" required/> |
| 18 | + </div> |
| 19 | + <div id="procaptcha-container"></div> |
| 20 | + <!-- Dev sitekey --> |
| 21 | + <div |
| 22 | + class="procaptcha" |
| 23 | + data-theme="light" |
| 24 | + data-sitekey="5HUBceb4Du6dvMA9BiwN5VzUrzUsX9Zp7z7nSR2cC1TCv5jg" |
| 25 | + ></div> |
| 26 | + <input type="submit" class="mui-btn mui-btn--raised"/> |
| 27 | + </form> |
| 28 | +</div> |
| 29 | +<script> |
| 30 | + // A function that will call the render Procaptcha function when the procaptcha script has loaded |
| 31 | + document.getElementById('procaptchaScript').addEventListener('load', function () { |
| 32 | + |
| 33 | + // Define a callback function to be called when the CAPTCHA is verified |
| 34 | + window.onCaptchaVerified = function (output) { |
| 35 | + console.log('Captcha verified, output: ' + JSON.stringify(output)) |
| 36 | + } |
34 | 37 |
|
35 |
| - // Render the CAPTCHA explicitly on a container with id "procaptcha-container" |
36 |
| - procaptcha.render('procaptcha-container', { |
37 |
| - siteKey: '5HUBceb4Du6dvMA9BiwN5VzUrzUsX9Zp7z7nSR2cC1TCv5jg', |
38 |
| - theme: 'dark', |
39 |
| - callback: 'onCaptchaVerified', |
40 |
| - }) |
41 |
| - </script> |
42 |
| - </body> |
| 38 | + // Render the CAPTCHA explicitly on a container with id "procaptcha-container" |
| 39 | + window.procaptcha.render('procaptcha-container', { |
| 40 | + siteKey: '5HUBceb4Du6dvMA9BiwN5VzUrzUsX9Zp7z7nSR2cC1TCv5jg', |
| 41 | + theme: 'dark', |
| 42 | + callback: 'onCaptchaVerified', |
| 43 | + }) |
| 44 | + }) |
| 45 | +</script> |
| 46 | +</body> |
43 | 47 | </html>
|
0 commit comments