From 2f5f9088e5118df41e31769c391b2288e77e6825 Mon Sep 17 00:00:00 2001 From: guidons Date: Tue, 26 Mar 2024 10:32:52 +0800 Subject: [PATCH] fixed --- themes/Lab/source/js/main.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/themes/Lab/source/js/main.js b/themes/Lab/source/js/main.js index 25e7109..5bd5b51 100644 --- a/themes/Lab/source/js/main.js +++ b/themes/Lab/source/js/main.js @@ -22,11 +22,13 @@ function loadScript(src, defer, async, autoReplaceSvg, root = "/hexo-theme-lab") }; })(); -loadScript("/js/fontawesome.js", false, true, "nest"); -loadScript("/js/header.js", true, false); -loadScript("/js/footer.js", true, false); -loadScript("/js/pagination.js", true, false); -loadScript("/js/team.js", true, false); -loadScript("/js/search.js", true, false); +document.addEventListener('DOMContentLoaded', function() { + loadScript("/js/fontawesome.js", false, true, "nest"); + loadScript("/js/header.js", true, false); + loadScript("/js/footer.js", true, false); + loadScript("/js/pagination.js", true, false); + loadScript("/js/team.js", true, false); + loadScript("/js/search.js", true, false); +}); console.log("main.js loaded") \ No newline at end of file