I tried this in my code :
<head>
<meta charset="utf-8">
<script type="text/javascript" src = "a.js"></script>
<script type="text/javascript" src = "b.js"></script>
</head>
a.js contains
console.log("a.js");
show();
b.js contains
console.log("b.js");
function show() {
console.log("function show()");
};
However the console shows error :Uncaught ReferenceError: show is not defined
As I combine a.js and b.js into one, it works OK.
So why is this happening when I have multiple source files? I thought it was the same as one single file with the content of both.
Besides, are there something else I should notice when I use multiple js sources?