+2 votes
by
Good day!
Prompt how to make so that when you click on the link on the page is dynamically loaded recaptcha.
At this time, only creates the div-
<div id="recaptcha2"></div>
And it stays blank, nothing is displayed.
481ca0d5d4a34855bf94b201dee29026.jpg

When you click:079a4ed96e354cd7b6f293cb985c045f.jpg

2 Answers

0 votes
by
thank you reprinted the google documentation!
by
Stepan Davestewart Remove the settings when the script loads
<script src="https://www.google.com/recaptcha/api.js" async defer>
by
magazovski : ReCAPTCHA couldn't find user-provided function onloadCallback
by
You're welcome! Were you able to apply this newly acquired knowledge?
0 votes
by
Here is the documentation: to call a method grecaptcha.render

<html>
<head>
<title>reCAPTCHA demo: Explicit render after an onload callback</title>
<script type="text/javascript">
var onloadCallback = function() {
grecaptcha.render('html_element', {
'sitekey' : 'your_site_key'
});
};
</script>
</head>
<body>
<form action="?" method="POST">
<div id="html_element"></div>
<br>
<input type="submit" value="Submit">
</form>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
async defer>
</script>
</body>
</html>
...