TetraPengwin
TetraPengwin

Reputation: 45

Include JavaScript file in another JavaScript file on a local drive

I have seen many ways to include a JS file in another JS file, but all of them seem to require the files to be located on a server, as opposed to on the local drive. Is there any way to include a JS file in another while keeping all files on the local drive?

Upvotes: 0

Views: 105

Answers (1)

TetraPengwin
TetraPengwin

Reputation: 45

In the html file, add 2 script tags, with the src property of the top one being to one you want to include in the other

<script src="include.js"></script>
<script src="code.js"></script>

Upvotes: 1

Related Questions