Open Benjaminhu opened 2 years ago
I am also experiencing this issue with the code sample
We ran into this issue as well: the code doesn't work as published!
It's strange, I'm not sure what situation or problem they may have wanted to solve or address via that logic, but it isn't correct as-is. I wonder how many sites around the internet are broken in a subtle way because of that snippet in the docs? :thinking:
Here's the implementation we are using to accomplish this:
if (typeof grecaptcha === 'undefined') {
grecaptcha = {
ready: callback => {
const c = '___grecaptcha_cfg';
window[c] = window[c] || {};
(window[c].fns = window[c].fns || []).push(callback);
}
};
}
Official "Loading reCAPTCHA asynchronously" does not work:
https://jsfiddle.net/657b1gso/
The problem: