title: reCAPTCHA AJAX API not working consistently in modal dialog box in Safari
body: <p>I'm using reCAPTCHA via its AJAX API to display the captcha in a modal dialog box. I'm using jqModal to display the boxes, and I'm using the AJAX version of reCAPTCHA because the PHP version is already buggy with jqModal (a known bug: <a href="http://markmail.org/message/bvip5vyb3czm7ngu" rel="nofollow noreferrer">http://markmail.org/message/bvip5vyb3czm7ngu</a>).</p>
  
  <p>Now, the reCAPTCHA works fine in Firefox. But in Safari, it doesn't always get displayed. Sometimes, it works fine, but about 20% of the time, no reCAPTCHA box is displayed.</p>
  
  <p>The jqModal declaration looks like this:</p>
  
  <pre><code>$().ready(function() {
    $('#modalBox_register').jqm({
    ajax: '/modals/register.php',
    trigger: 'a#registerButtonLink',
    onShow: function(h) {
     h.w.css('opacity', 1.00).fadeIn(300);
     },
    onHide: function(h) {
     h.w.fadeOut(300, function() { if (h.o) h.o.remove(); });
     }
   });
  });
  </code></pre>
  
  <p>And the HTML/PHP within the modal box looks like this:</p>
  
  <pre><code>&lt;div id="registerModal"&gt;
   &lt;p class="caption"&gt;Registration form:&lt;/p&gt;
   &lt;form name="registerForm" id="modalRegisterForm" class="modalForm" action="/register/" method="post"&gt;
  
     &lt;table cellspacing="15" border="0"&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="firstName"&gt;First Name:&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="text" name="firstName" id="firstName" value="" class="registerModalTextField" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="lastName"&gt;Last Name:&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="text" name="lastName" id="lastName" value="" class="registerModalTextField" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="email"&gt;Email Address:&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="text" name="email" id="email" value="" class="registerModalTextField" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="password"&gt;Password:&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="password" name="password" id="password" value="" class="registerModalTextField" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="passwordConfirm"&gt;Confirm Your Password:&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="password" name="passwordConfirm" id="passwordConfirm" value="" class="registerModalTextField" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
       &lt;td class="left"&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;div id="termswrap"&gt;
        &lt;input id="terms" type="checkbox" name="terms" /&gt;
                 &lt;label id="lterms" for="terms"&gt;&amp;nbsp;I have read and accept the &lt;a href="/backmatter/termsofuse/"&gt;Terms of Use.&lt;/a&gt;&lt;br /&gt;&lt;/label&gt;
                &lt;/div&gt;&lt;!-- /#termswrap --&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  
      &lt;!-- reCAPTCHA --&gt;
      &lt;tr&gt;
       &lt;td class="left"&gt;&lt;label for="captcha"&gt;Are you human?&lt;/label&gt;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;!-- Using the reCAPTCHA AJAX API, because the non-AJAX API is buggy with jqModal --&gt;
       &lt;div id="recaptcha_div"&gt;&lt;/div&gt;
       &lt;script type="text/javascript"
        src="http://api.recaptcha.net/js/recaptcha_ajax.js"&gt;&lt;/script&gt; &lt;script
        type="text/javascript"&gt;
            Recaptcha.create("123456789...",
             "recaptcha_div", {
               theme: "white"
            });
           &lt;/script&gt;
  
       &lt;/td&gt;
      &lt;/tr&gt;
  
  
      &lt;tr&gt;
       &lt;td class="left"&gt;&amp;nbsp;&lt;/td&gt;
       &lt;td class="right"&gt;&lt;input type="image" id="submitButton" src="/images/modals/button_register.png" value="Submit" alt="Submit" name="submit" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
     &lt;/table&gt;
  
  
   &lt;/form&gt;
  &lt;/div&gt;&lt;!--/#registerModal--&gt;
  </code></pre>
  
  <p>Does anybody have a clue why the reCAPTCHA AJAX call isn't working properly in Safari?</p>