diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 26836185469f0..a47854588847b 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -59,8 +59,6 @@ public function onInit($id = 'dynamic_recaptcha_1') $file = $app->isSSLConnection() ? 'https' : 'http'; $file .= '://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; - JHtml::_('script', $file); - $document->addScriptDeclaration('jQuery( document ).ready(function() { Recaptcha.create("' . $pubkey . '", "' . $id . '", {theme: "' . $theme . '",' . $lang . 'tabindex: 0});});' @@ -72,15 +70,13 @@ public function onInit($id = 'dynamic_recaptcha_1') $file = $app->isSSLConnection() ? 'https' : 'http'; $file .= '://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage() ->getTag() . '&onload=onloadCallback&render=explicit'; - - JHtml::_('script', $file, true, true); - $document->addScriptDeclaration('var onloadCallback = function() {' . 'grecaptcha.render("' . $id . '", {sitekey: "' . $pubkey . '", theme: "' . $theme . '"});' . '}' ); break; } + JHtml::_('script', $file); return true; }