【发布时间】:2019-01-16 17:37:47
【问题描述】:
<html>
<head>
<script src="./first.js"></script>
<script src="./second.js"></script>
</head>
</html>
在first.js文件中,我想调用second.js中的函数:
secondFun(); // calling a function from second.js file
这是 second.js 文件:
function secondFun() {
console.log('second function called!!')
}
【问题讨论】:
-
只需颠倒您包含的脚本的顺序。这将解决您的问题。
标签: javascript html function console.log