title: google reCAPTCHA: iframe src is undefined
body: <p>HTML:</p>
  
  <pre><code>&lt;script src="https://www.google.com/recaptcha/api.js" async defer&gt;&lt;/script&gt;
  &lt;!-- Suggest Modal --&gt;
      &lt;div id="suggestModal" class="modal fade anycard-modal" role="dialog"&gt;
          &lt;div class="modal-dialog"&gt;
  
              &lt;!-- Modal content--&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" id="modal-close" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;Business Suggestion&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;div id="suggest-area"&gt;
                          &lt;form id="suggestion-form"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;span class="aster"&gt;*&lt;/span&gt;
                                  &lt;label for="s-name"&gt;Name:&lt;/label&gt;
                                  &lt;input type="text" class="form-control" id="s-name"&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;span class="aster"&gt;*&lt;/span&gt;
                                  &lt;label for="s-email"&gt;Email:&lt;/label&gt;
                                  &lt;input type="text" class="form-control" id="s-email"&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;span class="aster"&gt;*&lt;/span&gt;
                                  &lt;label for="s-idea"&gt;Business suggestion:&lt;/label&gt;
                                  &lt;textarea class="form-control" id="s-idea"&gt;&lt;/textarea&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;div class="g-recaptcha" data-sitekey="6LdoqQoUAAAAAHNBx5GxMXYq_8FfxZMUf09bn7QI"&gt;&lt;/div&gt;
                              &lt;/div&gt;
                              &lt;button type="submit" class="btn btn-primary"&gt;Submit your suggestion&lt;/button&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;&lt;!-- /Suggest Modal --&gt;
  </code></pre>
  
  <p>I am facing the problem with google reCAPTCHA. It's not loading properly. Then i inspect the browser and see the problem occurs on iframe. It's source is undefined.</p>
  
  <pre><code>&lt;iframe src="undefined?autoplay=1" title="recaptcha widget" width="304" height="78" role="presentation" frameborder="0" scrolling="no" name="undefined"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>The Ajax code is given below which i used or form submit.
  Ajax:</p>
  
  <pre><code>$('#suggestion-form').submit(function(e) {
      e.preventDefault();
      var form_data = new FormData();
      var name = $('#s-name').val();
      var email = $('#s-email').val();
      var suggestion = $('#s-idea').val();
  
      form_data.append('name', name);
      form_data.append('email', email);
      form_data.append('suggestion', suggestion);
  
      $.ajax({
      url: 'default.php?controller=queries&amp;action=addsuggestion',
      type: 'POST',
      data: form_data,
      processData: false,
      contentType: false,
      success: function(data) {
          if(data.success) {
          $('#suggest-area')
              .find('.alert').remove()
              .end()
              .prepend('&lt;div class="alert alert-success alert-dismissible" role="alert"&gt;&lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;Thank you for your valuable suggestion&lt;/div&gt;');
          window.setTimeout(function(){
              //$('#suggestModal').modal('hide');
              $('#modal-close').click();
              $('#suggestion-form')[0].reset();
              $('#suggest-area').find('.alert').remove();
          }, 2000);
          }else{
          var error = '';
  
          switch(data.error) {
              case 'fillFields':
                  error = 'Please fill in all the fields';
              break;
              case 'invalidEmail':
                  error = 'The provided email is invalid';
              break;
          }
          $('#suggest-area')
              .find('.alert').remove()
              .end()
              .prepend('&lt;div class="alert alert-danger alert-dismissible" role="alert"&gt;&lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;&lt;strong&gt;Error:&lt;/strong&gt; '+error+'.&lt;/div&gt;');
  
          }
      }
      });
  </code></pre>
  
  <p>i can't understand why the iframe src is undefined. reCAPTCHA is not loading properly because of the undefined source of iframe. Please help me to solve this problem.</p>