Fix dynamic loading js files bug

This commit is contained in:
2023-01-30 16:30:05 +08:00
parent e68ddb6b8e
commit 3281789157

View File

@@ -201,7 +201,7 @@
script.src = 'resources/js/' + names[i] + '?randomId=' + radomTime; script.src = 'resources/js/' + names[i] + '?randomId=' + radomTime;
script.onload = () => { script.onload = () => {
loadedCount++; loadedCount++;
if (loadedCount >= names.length - 1) setTimeout(() => { callback(); }, 150); if (loadedCount >= names.length) setTimeout(() => { callback(); }, 150);
}; };
document.body.appendChild(script); document.body.appendChild(script);
} }