1)test1.js
function test() {
console.log(1);
}
window.test1 = test;
2)test2.js
function test() {
console.log(2);
}
window.test2 = test;
3)index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="./test1.js"></script>
<script type="text/javascript" src="./test2.js"></script>
<script type="text/javascript">
test();
test1();
test2();
</script>
</head>
<body>
</body>
</html>
4)显示结果