Moving the google recaptcha/api.js to below the fold
-
Hey,
I’m using Zerif lite with the pirate plugin. When I enable the recaptcha it puts a <script tag in the header pointing to the google api. I would like the move this to the footer since My contact form is below the fold. I was looking through the template files and could not find where that code is. I’m guessing its in the theme files and its mostly php but I tried seaching for the beginning of the <scr tag and still couldn’t find it. Any help on locating it would be great. I would like to use this code to call that .js so I can defer it to load until after the page.
<script type=”text/javascript”>
function downloadJSAtOnload() {
var element = document.createElement(“script”);
element.src = “defer.js”;
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener(“load”, downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent(“onload”, downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
- The topic ‘Moving the google recaptcha/api.js to below the fold’ is closed to new replies.