AnsweredAssumed Answered

Seperate JS files

Question asked by jay.kapalczynski on Jan 31, 2018
Latest reply on Jan 31, 2018 by jay.kapalczynski

I have an app that is starting to get a rather large amount of JS.

I was wondering if I could start to separate certain bits of code in a separate JS file and then just reference them.

 

If I reference it in HTML as I do the main JS file I get errors saying the map is not defined.

<script src="js/index.js"></script>
<script src="js/elevationprofile.js"></script>

 

Is there a way to reference all the split out JS files in the main JS file?

Outcomes