#perfaudit

Performance Audit Of Web Applications By Professionals

Asynchronous resource loading | Best Practices | Networking Performance

Fetching of resources in a fashion which is non-render blocking is termed as asynchronous resource fetching.

There are several ways to load resources asynchronously:

function stylesheet(url) {
    var s = document.createElement('link');
    s.type = 'text/css';
    s.src = url;
    var x = document.getElementsByTagName('head')[0];
    x.appendChild(s);
}
function script(url) {
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = url;
    var x = document.getElementsByTagName('head')[0];
    x.appendChild(s);
}

Using async attribute

<script async src="script.js"></script>

or by using defer attribute against script tags

<script defer src="script.js"></script>


Share

Subscribe
Subscribe
Audit Requests

Want us to audit your Website?

We'll audit the page load and rendering performance of your web application.
Share your contact and we'll get back to you very soon.