So I have a js file called sankey.js that has this content -
console.log("HELLO WORLD");
I load it in an index.html file that looks like this
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javacript" src="sankey.js"></script>
<script type="text/javacript" src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.1/backbone-min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<body>
<h1> TEST </h1>
</body>
This is served by a golang webserver - the rest of the code is in this question.
I successful find the file, but the console.log does not show.
Why?
I even added a debugger, like this
debugger;
console.log("HELLO WORLD");
And that is not run.
My guess based on having a similar problem when I wrote my own basic web server using Go (golang) was that I got the paths to the file mixed so it was getting 404 Not Found
.
I recomend using the Network tab in Chrome debug (F12) to check that the sankey.js
is actually being served to the browser.