User1535942433 posted
Hi pathipati,
The function could be called as if it was in the same JS File as long as the file containing the definition of the function has been loaded before the first use of the function.
A function cannot be called unless it was defined in the same file or one loaded before the attempt to call it.
A function cannot be called unless it is in the same or greater scope then the one trying to call it.
File1.js:
function alertNumber(number) {
alert(number);
}
File2.js:
function alertOne() {
alertNumber("one");
}
<head>
....
<script src="File1.js" type="text/javascript"></script>
<script src="File2.js" type="text/javascript"></script>
....
</head>
<body>
....
<script type="text/javascript">
alertOne();
</script>
....
</body>
Best regards,
Yijing Sun