Skip to content

Instantly share code, notes, and snippets.

@uestla
Created March 24, 2017 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uestla/8473c35c78300fbb9a58d893341e8bc6 to your computer and use it in GitHub Desktop.
Save uestla/8473c35c78300fbb9a58d893341e8bc6 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function (window, $) {
window['grecaptchaInit'] = function () {
$.nette.ext({
init: function () {
$('.g-recaptcha').each(function () {
var recaptcha = $(this);
if (recaptcha.children().length) { // already processed -> skip
return ;
}
grecaptcha.render(recaptcha[0], {
sitekey: recaptcha.attr('data-sitekey')
});
});
},
load: function () {
grecaptcha.reset();
}
});
$.nette.init();
};
})(window, window.jQuery);
</script>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?onload=grecaptchaInit&amp;render=explicit"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment