Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in console #30

Closed
simpledev opened this issue Dec 22, 2015 · 7 comments
Closed

Error in console #30

simpledev opened this issue Dec 22, 2015 · 7 comments

Comments

@simpledev
Copy link

Hi,

The captcha work but why is there this error in the console ?
Uncaught Error: ReCAPTCHA placeholder element must be empty

Thank's !

@NickBWM
Copy link

NickBWM commented Dec 23, 2015

I'm getting the same error, but can't work out why as the placeholder element is empty.
This isn't the only reCaptcha script I've tried with the same error, so I'm wondering if it's an issue with reCaptcha as a service, instead of an error with this script. Is anyone else getting this error?
And is anyone able to debug/resolve this?

@paulocastellano
Copy link

+1

@NickBWM
Copy link

NickBWM commented Jan 14, 2016

I worked out the issue with my site - the reCapcha code was included twice, once in the main template, and once by the script. One of the downfalls of having multiple developers on one build I guess.
I hope this helps some of you guys, as far as I've found, there is no issue with the script itself - only issues with the implementation.
Cheers,

@findelallc
Copy link

findelallc commented Aug 25, 2016

Please note the recaptcha code must not be enclosed with any kind of wrapper like div/span etc. else it will start throwing error.
only {!! app('captcha')->display(); !!}

@ooocrniooo
Copy link

i have the same error, and i can't resolve it!
Any other suggestions?

@simpledev
Copy link
Author

simpledev commented Dec 10, 2016

Like this <div>{!! app('captcha')->display(); !!}</div> there is an error in the console but without <div> or any tag {!! app('captcha')->display(); !!} it works for me.

@loburets
Copy link

Just youse this for each captcha at the page if you need dynamic including:

    <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
            async defer>
    </script>

    <div class="g-recaptcha"></div>

    <script>
        var onloadCallback = function() {
            //remove old
            $('.g-recaptcha').html('');

            $('.g-recaptcha').each(function (i, captcha) {
                grecaptcha.render(captcha, {
                    'sitekey' : 'your key'
                });
            });
        };
    </script>

But it is slow. You can also define all recaptchas at page initially:
https://developers.google.com/recaptcha/docs/display

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants