Google recaptcha error in ie 11

前端 未结 5 1545
北荒
北荒 2021-02-06 01:48

I am getting the following error in IE 11:

SCRIPT5007: unable to get property \"toString\" of undefined or null reference recaptcha__iw.js (451, 41)

5条回答
  •  -上瘾入骨i
    2021-02-06 02:08

    The answer of Ruthi works on IE, but not on Google Chrome (error at runtime), so, for a cross-browser solution, you need first to ensure that the browser can handle querySelector().setActive

    So, put this javascript code before the recaptcha rendering:

    if(document.querySelector('body').setActive != undefined)
    {
        document.querySelector('body').setActive();
    }
    

提交回复
热议问题