Skip to content

Instantly share code, notes, and snippets.

@jamigibbs jamigibbs/vf-recaptcha-2.js Secret
Last active Jun 11, 2019

Embed
What would you like to do?
window.addEventListener("message", function(event) {
if (event.data.type === 'CAPTCHA-SITEKEY') {
sitekey = event.data.key;
hostURL = event.data.hostURL;
var gCaptchaScript = document.getElementById('g-captcha-script')
if (!gCaptchaScript) {
var script = document.createElement('script');
head = document.head || document.getElementsByTagName('head')[0];
script.src = `https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit`
script.id = 'g-captcha-script'
document.head.insertBefore(script, head.firstChild);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.