Async JavaScript

by Frank Goossens (futtta) for 4.6 or higher

Download Now

Downloaded: 4

Free WordPress JavaScript plugin

Frank Goossens developed the free Async JavaScript plugin. You can use the plugin to eliminate render-blocking Javascript (JS) content above the fold. It’s compatible with WordPress 4.6 and up. You can download it for free in five languages: Dutch, US English, and three Spanish dialects 

This app gives you complete control over adding and eliminating defer or await attribute to scripts and help to increase site loading speed. Other plugins offering asynchronous JS loading are Lazy Widget Loader and Reverb for Publishers.

Asynchronous loading explained

Usually, WordPress loads scripts one at a time. Since it must fully load one item before loading the next, it increases the site’s overall loading time.

Asynchronous loading lets files load in parallel. Developers do so by adding an async attribute to your Javascripts or a ‘defer’ attribute to exclude specific scripts. 

Browser support and CSS

Async is a new attribute in HTML 5 and Chrome, Internet Explorer 10 and up, Firefox 3.6 and up, Safari and Opera. It only works with built-in WordPress script queuing. 

Another handy attribute to use with async is await, which is helpful for web API functions. Please remember that await only works within async functions. A specific condition is set, and only when this condition is met will the Javascript load asynchronously. 

The plugin works only with JS and doesn’t change your CSS scripts in any way. To optimize CSS, you’ll need a dedicated plugin for this functionality.

Increase website performance

Async JavaScript gives site owners a way to load JavaScript asynchronously or to eliminate or defer the loading of specific scripts, decreasing page loading time. Another helpful option is ‘await’, where the scripts only load once a particular condition is met. Await also simplifies coding

With the latest release, the developer has added a workaround for specific inline JS scripts getting synced asynchronously.