Good day, I have a form for sending a question on the main page, the usual google recaptcha v2 is connected to it, everything works fine until I start running through the other pages of the site (they all connect without rebooting, the content part is loaded by Ajax). And now, after any Ajax request, the recaptcha on the main page disappears.

Maybe someone had a similar problem?

  • show errors from the console. Guessing on goat poop, we unfortunately do not know how. - Jean-Claude
  • @ Jean-Claude is just that, there are no errors, among other things, and the console with a log check that there is nothing. I described the problem as best I could, more than that and nothing to give, do not throw all the huge code here. Just after any Ajax request to the server, the recaptcha disappears, without any errors. The page with all this does not reload. - Demian Shumilov
  • what does the recaptcha disappear? Does its HTML code disappear from the page? - Jean-Claude
  • @ Jean-Claude is not there, the code remains in place, no errors take off, the recaptcha frame disappears (it is not visible visually - height 0) I also tried to reload the recaptcha after the Ajax request, but the effect did not change. All the scripts are in place, but the recaptcha is not visible at the block, the height and width parameters disappear. - Demian Shumilov
  • Well, make it so that it does not disappear. - Jean-Claude

1 answer 1

Oh, yes, I forgot. Actually the problem was that the recaptcha script was connected to the header along with all the scripts (which is static), and the content part in which the recaptcha was located (rebooted by the Ajax).

The problem was solved by adding recaptcha / api.js' to the content part.