ReCAPTCHA couldn't find user-provided function: myCallBack

♀尐吖头ヾ 提交于 2019-12-04 23:58:50

Make sure your callback function is being defined in the global scope. For some reason, in production my function was not in this namespace.

In addition to:

function myCallback() { ... }

Make sure you directly assign it into the global space:

window.myCallback = myCallback;

You should be able to test whether this is your problem, my typing the function name at the Javascript console and seeing if it's defined or not.

In your recaptcha div, make sure not to use parenthesis in your data-callback.

Like so data-callback="yourCallback", rather than data-callback="yourCallback();"

The same thing happening with me.I have checked my code carefully, every thing is fine but captcha not shown and in console the message is "ReCAPTCHA couldn't find user-provided function: myCallBack" but finally I found that my JavaScript code was is in page load function. I am just put out it from page load function and its working.

You have to put your script function:

<script> function registerFormCheck()</script>

Before the google script something like this:

/* First */    <script> function registerFormCheck(){} </script>
/* Second */   <script> src='https://www.google.com/recaptcha/api.js'></script>

This worked for me...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!