Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Add reCAPTCHA Script Directly -->
- <script src="https://www.google.com/recaptcha/api.js?render=6Ld8KSMpAAAAAL1ITylghSdtPwT2Qy8JB8eIeCG6"></script>
- <!-- Add reCAPTCHA HTML -->
- <input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response">
- <!-- Add custom script to execute reCAPTCHA -->
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- console.log('DOM fully loaded and parsed');
- if (typeof grecaptcha !== 'undefined') {
- <!--console.log('grecaptcha is defined');-->
- grecaptcha.ready(function() {
- <!--console.log('grecaptcha ready');-->
- grecaptcha.execute('6Ld8KSMpAAAAAL1ITylghSdtPwT2Qy8JB8eIeCG6', {action: 'checkout'}).then(function(token) {
- <!--console.log('reCAPTCHA token generated:', token);-->
- var recaptchaResponse = document.getElementById('g-recaptcha-response');
- recaptchaResponse.value = token;
- });
- });
- } else {
- console.log('grecaptcha is not defined');
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement