Google reCAPTCHA failed for second time on the bootstrap model

Viewed 1109

I have a form with multiple fields & google recaptcha which I open in popup model.For the first time everything work well.

enter image description here

But when I close popup and try to open popup second time at that time I got error "Not Found.The requested url was not found on this server". enter image description here

Here is my HTML code:

  <div id="RecaptchaField2"></div>

Javascript :

<script type='text/javascript'>
  var CaptchaCallback = function() {
      if ( $('#RecaptchaField2').length ) {
        grecaptcha.render('RecaptchaField2', {'sitekey' : 
            '6LdG1ioUAAAAANOH2BnJO_5zv0NE2UNZS9jou7Yh'
       });
      }
   }

    $(".inq-button").click(function(){
      setTimeout(function() {
          var script = document.createElement('script');
          script.src = 'https://www.google.com/recaptcha/api.js?
          onload=CaptchaCallback&render=explicit';
          script.type = 'text/javascript';
         document.body.parentNode.appendChild(script);         
     }, 100); 
   });
</script>

This problem is torturing me since last week and I still couldn't figure out why it happens.

Would you please give me proper suggestion about this?

Any kind of help would be highly appreciated.

Thanks in advance.

2 Answers
Related