One way to improve the overall pagespeed of your site is to load scripts deferred or async. When you load this way. The following wrapper for all your scripts will make sure that nothing is executed until the DOM is ready for you
document.addEventListener("DOMContentLoaded", function(event) { // Put all your vanilla scripts within this function jQuery(function($) { // Put all your Jquery related functions inside this function }); });
Leave a Reply