The script must be loaded using the HTTPS protocol and can be included from any point on the page without restriction.
Programmatically bind the challenge to a button or invoke the challenge.
Programmatically invoke the challenge.
Invoking the reCAPTCHA verification programmatically can be achieved by rendering the challenge in a div with an attribute data-size=’invisible’ and programmatically calling execute.
Note: your onload callback function must be defined before the reCAPTCHA API loads. To ensure there are no race conditions:
order your scripts with the callback first, and then reCAPTCHA
use the async and defer parameters in the script tags