-
Hi,
First of all I really have to tell you that I like the HTML version Auqa theme. Everything works fine, however there is one thing that I’m struggling with and I hope you can help me a little bit with this.
I do have some problems with defer parsing javascript. Now most people use the wordpress theme and I did find some information about defer parsing javascript on your website, but most if not all are related to the wordpress version. I use the HTML version so I cannot use any wordpress plugins for defer parsing javascript.
So I did use the code below to defer the JS files:
<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>This is a pretty standard code that I found on several (authorative) websites. This code needs to be placed just before </body> and only excutes javascript after the page has been build.
However when I apply this code for all the files, javascript will not execute at all.
Now there are some JS files that are necessary to build a page. I think that I can find some of the files/code that is necessary to build the page, however whatever I do I do not get it to work properly.
The code however must be doing something right as Google PageSpeed Insights does not see javascript as a problem anymore after applying the code.
Now is my question: Do you have some information of how to defer parse javascript correctly for this particular HTML theme? Maybe not with the code as shown about other methods like using async, which also caused a problem when I implemented it is also fine.
Thanks for in advance for reading and replying to my topic.
Kindest regards, Robert Hofstede
- Theme support is offered to verified customers only. To post a topic go to your Theme Category and add your question at the page bottom.
Theme Categories
Recent Topics
- Alea updates
- Why "Fortune" theme is no longer available?
- PHP 8.1 Error
- Issue with WPB editor icons
- Issue with Icons and Text Alignment for Arabic Content
- Installing and Activating Plugin Fortuna Portfolio CPT (1/8)
- Testimonials page is blank
- warning boc_framework line 905
- Transparent header issue without changes
- Slider Revolution error