Async JS loading/evaluation
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<link rel="preload" href="proxima-nova-semibold.woff2" as="font" type="font/woff2" crossorigin>
|
<link rel="preload" href="proxima-nova-semibold.woff2" as="font" type="font/woff2" crossorigin>
|
||||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||||
<link rel="stylesheet" href="passmate.css">
|
<link rel="stylesheet" href="passmate.css">
|
||||||
<script src="passmate.js"></script>
|
<script src="passmate.js" async="true"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
10
passmate.js
10
passmate.js
@@ -281,6 +281,12 @@ class PassMate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
function onReady() {
|
||||||
new PassMate(document.getElementsByTagName('body')[0]);
|
new PassMate(document.getElementsByTagName('body')[0]);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
if (document.readyState === "loading") {
|
||||||
|
document.addEventListener('DOMContentLoaded', onReady);
|
||||||
|
} else {
|
||||||
|
onReady();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user