Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Sure, I will push a new version now with async loading ??

    Thread Starter schwimmlehrer

    (@schwimmlehrer)

    Just a note the code from Google did not work I found another hack in the internet but I think it might not be a good solution for production use. I will check what you did when I have time appreciate it. (This is the code I think I did:

    <script>
    	grecaptcha = {};
    	___grecaptcha_cfg = {}
    	___grecaptcha_cfg.fns = []
    	grecaptcha.ready = function (cb) {
    	  ___grecaptcha_cfg.fns.push(cb)
    	}
    	grecaptcha.ready(function() {
    					grecaptcha.execute('XXXXXXXXXXXX', {action: 'login'}).then(function(token) {
    	var tokenfield = document.getElementById('XXXXXXXXX').querySelectorAll('[name=mcfb_token]');
    	if (!tokenfield) {
    		console.log('The Contact Form Block will not be working, the token field could not be found.');
    		return;
    	}
    						tokenfield[0].setAttribute('value', token);
    	});
    });
    </script><script async src='https://www.google.com/recaptcha/api.js?render=XXXXXX'></script><form id='XXXXXXXX' method='post' action='' class='meow-contact-form meow-contact-form--default'><div class='meow-contact-form__header'>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘load recaptcha async’ is closed to new replies.