I'm trying to get jQuery to asynchronously load my recaptcha module, but it doesn't seem to like the fact that "echo recaptcha_get_html ($publickey);" spits out a mixture of HMTL and Javascript.
Here's the code I am trying: <script> $.ajax({ url: "inc/captcha.php", cache: false, success: function(html){ //$("#results").append(alert(html); $("#results").append(html); } }); // This does the same thing /*$.post("inc/test.php",function(returned_data){ $("#results").append(returned_data); });*/ </script> <div id="results"></div> It spits me out to a page with _just_ the recaptcha widget. I tested to see if it was my ajax call by making 'inc/captcha.php' merely say "Hello!" but it works. The offending reCAPTCHA code is possibly: <script type="text/javascript" src="http://api.recaptcha.net/challenge? k=6Lfz5AkAAAAAAKMcQLT5Q8_PrBHNZx4B8v34ABCC"></script> <noscript> <iframe src="http://api.recaptcha.net/noscript? k=6Lfz5AkAAAAAAKMcQLT5Q8_PrBHNZx4B8v34ABCC" height="300" width="500" frameborder="0"></iframe><br/> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></ textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/> </noscript>