Created
January 25, 2015 15:51
-
-
Save ssddanbrown/2f89e0c34fde89f9fcf4 to your computer and use it in GitHub Desktop.
Mulitple Google Captchas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Remote Google Script--> | |
<script src="https://www.google.com/recaptcha/api.js?onload=onCaptchaLoad&render=explicit" async defer></script> | |
<!--Local site script--> | |
<script> | |
var onCaptchaLoad = function() { | |
var captchaElements = document.querySelectorAll('div[data-captcha="true"]'); | |
for (var i = captchaElements.length - 1; i >= 0; i--) { | |
grecaptcha.render(captchaElements[i], { | |
'sitekey': 'SITE_KEY', | |
'theme': 'light' | |
}); | |
} | |
}; | |
</script> | |
<!--Inserting a captcha--> | |
<div data-captcha="true"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment