I am trying to render a reCAPTCHA widget in a "contact us" page using the following js:
<script>
function enableSubmit(){...}
function disableSubmit(){..}
$(function (){
var onloadCallback = function() {
grecaptcha.render('reCaptcha', {
'sitekey' : [site_key],
'theme' : 'light',
'callback' : enableSubmit
});
};
document.write('<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"><\/script>');
});
</script>
The page throws this error:
onloadwff.js:71 Uncaught (in promise) TypeError: Cannot read property 'querySelectorAll' of null
at s.<anonymous> (onloadwff.js:71)
at l (onloadwff.js:71)
at Object.next (onloadwff.js:71)
at n (onloadwff.js:71)
Which seems to be due to the line starting "document.write.."
My details are below.
Lastpass extension V 4.53.0
Browser: Chrome 84
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Operating system: Windows 10
Javascript enabled: Yes
Cookies enabled: Yes
Flash version: Not installed
Java version: Not installed
Websockets supported: Yes
WebGL supported: Yes
Language: en-GB
Browser size: 2543 x 1297
Screen size: 2560 x 1440
Color depth: 24 bit
AdBlock enabled: Yes
I am trying to render a reCAPTCHA widget in a "contact us" page using the following js:
The page throws this error:
Which seems to be due to the line starting "document.write.."
My details are below.
Lastpass extension V 4.53.0 Browser: Chrome 84 User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36 Operating system: Windows 10 Javascript enabled: Yes Cookies enabled: Yes Flash version: Not installed Java version: Not installed Websockets supported: Yes WebGL supported: Yes Language: en-GB Browser size: 2543 x 1297 Screen size: 2560 x 1440 Color depth: 24 bit AdBlock enabled: Yes