javascript - How to properly link external JS resources into a JS file? -
i creating dashboard shows different graphs in web application. got code snippets , edited needed. realized web application getting bigger. therefore, i'd decided create separate javascript files each graphs. initially, had tag @ bottom of html page works fine. have external resources such as;
<!-- external resources --> <script src="https://www.amcharts.com/lib/3/amcharts.js"></script> <script src="https://www.amcharts.com/lib/3/serial.js"></script> <!-- functions --> <script> // more codes here. these codes go new .js file </script>
question, on new .js file, how link these external resources correctly?
thanks in advance!
unless "external resources" scope code, can't access in global scope, able access in js file, within script tag, in document.
if javascript code working between <script>
tags, work when move file, , replace <script>
tags this:
<script src="/code.js"></script>
Comments
Post a Comment