• Skip to main content
  • Skip to footer

HeyRobot

Experts in development, SEO and technical optimisation of WordPress and React solutions

  • EnglishEnglish
    • DanskDansk
    • EnglishEnglish
  • Services
    • React SEO
    • React + WordPress solutions
    • Pagespeed Optimisation
    • WordPress custom development
    • WordPress premium plugins
    • Custom website development
  • About
    • Privacy Policy
  • Geek blog
  • Contact

Improve pagespeed score with simple trick

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
	});
});

Kim Frederiksen / 09/06/2019

Filed Under: Code snippets, Pagespeed optimisation

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Talk to us

You can always connect with us for an informal conversation or an objective look at your project

Call us at +45 30 27 95 56 or write us at info@heyrobot.com

Footer

Virtual runs

Information

  • Privacy Policy

Contact

HeyRobot
email: info@heyrobot.com

(C) 2019 HeyRobot