Inside the recaptcha.php file of the Recaptcha Plugin on Joomla 3.6, I have the following code:
case '2.0':
$theme = $this->params->get('theme2', 'light');
$file = 'https://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage()->getTag() . '&render=explicit';
JHtml::_('script', $file, true, true);
$document->addScriptDeclaration('jQuery(document).ready(function($) {$(window).load(function() {'
. 'grecaptcha.render("' . $id . '", {sitekey: "' . $pubkey . '", theme: "' . $theme . '"});'
. '});});'
);
break;
Which creates the string:
<script src="https://www.google.com/recaptcha/api.js?hl=en-US&render=explicit" type="text/javascript"></script>
loading the api.js for the recaptcha. Since I am using Rocket Loader from Cloudflare I would like to change this
<script src="https://www.google.com/recaptcha/api.js?hl=en-US&render=explicit" type="text/javascript"></script>
to this
<script data-cfasync="false" src="https://www.google.com/recaptcha/api.js?hl=en-US&render=explicit" type="text/javascript"></script>
where after the
I tried using a variable $cloud = 'data-cfasync="false"'; and changing JHtml::('script', $file, true, true); to JHtml::('script', $cloud, $file, true, true); or I tried JHtml::script data-cfasync="false" ($file, true, true); or JHtml::('script data-cfasync="false"', $file, true, true); or JHtml::('script'.'data-cfasync="false"', $file, true, true); And nothing worked....... I know some of them are stupid but I am not a real programmer as you have figured out already. How can I do that? Thanks