Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 45e41fb

Browse files
committed
In the latest Chrome release, it appears that scripts loaded dynamically without an async attr will now block rendering. This change restores the non-blocking behavior that was present before the latest chrome update.
1 parent 0d96d2d commit 45e41fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

loadJS.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function loadJS( src, cb ){
44
var ref = window.document.getElementsByTagName( "script" )[ 0 ];
55
var script = window.document.createElement( "script" );
66
script.src = src;
7+
script.async = true;
78
ref.parentNode.insertBefore( script, ref );
89
if (cb) {
910
script.onload = cb;

0 commit comments

Comments
 (0)