Firefox error: Ignored call to document.write() from an external script loaded asyncronouslly.

1,487 views
Skip to first unread message

David Garcia

unread,
Apr 2, 2013, 7:15:33 AM4/2/13
to reca...@googlegroups.com
When

https://api-secure.recaptcha.net/challenge?k=XXXXXX&_=1364900005592

is loaded and try to
document.write('<scr'+'ipt type="text/javascript" s'+'rc="' + RecaptchaState.server + 'js/recaptcha.js"></scr'+'ipt>');

I get this error on firefox (v.19.0.2) with html5:
Ignored call to document.write() from an external script loaded asyncronouslly.



[...]
Even if I try to download straight (<script type="text/javascript" src="https://api-secure.recaptcha.net/js/recaptcha.js"></script>)
I get the same error at recaptcha.js (line 119)


Clon Takos

unread,
Apr 2, 2013, 11:03:06 AM4/2/13
to reca...@googlegroups.com
https://developer.mozilla.org/en-US/docs/HTML/Element/script#attr-async

Never call document.write() from an async script. In Gecko 1.9.2, calling document.write() has an unpredictable effect. In Gecko 2.0, calling document.write() from an async script has no effect (other than printing a warning to the error console).

 

Adrian Godong

unread,
Apr 2, 2013, 11:06:40 AM4/2/13
to reca...@googlegroups.com
*.recaptcha.net endpoint has been deprecated since 2010/2011 and the
HTTPS certificate has not been renewed. Update your plugin to the
latest version.
> --
> You received this message because you are subscribed to the Google Groups
> "reCAPTCHA" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to recaptcha+...@googlegroups.com.
> To post to this group, send email to reca...@googlegroups.com.
> Visit this group at http://groups.google.com/group/recaptcha?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Adrian Godong
adrian...@gmail.com

David Garcia

unread,
Apr 2, 2013, 11:07:59 AM4/2/13
to reca...@googlegroups.com
Thanks Clon,

Finally solved by using AJAX API, this way:

<div id="divRecaptcha"></div>
<script type="text/javascript">
$.getScript("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js", function() {
Recaptcha.create("XXXXXpublicKeyXXXXXX", "divRecaptcha", {
theme: "white"
});
});
</script>

Reply all
Reply to author
Forward
0 new messages