我有以下HTML。我知道在加载所有资源时将调用window.onload
。就我而言,资源是* .js文件。如何在加载前五个* js文件后立即触发window.onload
?
<html>
<body>
<h1>My body</h1>
</body>
<script src="file1.js"></script>
<script src="file2.js"></script>
<script src="file3.js"></script>
<script src="file4.js"></script>
<script src="file5.js"></script>
<!--I want to trigger window.onload here-->
<script src="file6.js"></script>
<script src="file7.js"></script>
<script src="file8.js"></script>
<script src="file9.js"></script>
<script src="file10.js"></script>
<script>
window.onload = function() {
console.log('window.onload');
};
</script>
</html>