I
I
Ilya2017-11-10 17:28:55
css
Ilya, 2017-11-10 17:28:55

Why does reCaptcha load a lot of js and css files?

There are several captchas on the page. In the debugger, it shows the loading of 4 styles__ltr.css and 4 recaptcha__ru.js files. I can't figure out how to fix multiple loading, below is the code:

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

var widgetIds = [];
var CaptchaCallback = function() {

  var widgets = document.querySelectorAll('.g-recaptcha');
  for (var i = 0; i < widgets.length; i++) {
    var widget = widgets[i];
    var widgetId = grecaptcha.render(widget, {
      'sitekey' :  'sitekey'
    });
    widgetIds.push(widgetId);
  }
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2017-11-10
@PavelMonro

https://developers.google.com/recaptcha/docs/displ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question