score:0

Accepted answer

1. Step 1

Firstly, Make Sure that your Java Script file visualization.js is still exists or check that according to you,visualization.js should located in the same directory which your html file located.

2. Step 2

But if it isn't thats the reason for getting 404 error,I recommend you to check the directory which your visualization.js file currently exists.

Try this;

Eg:- <script src="directory/visualization.js" type="text/javascript"></script>

In here I mean by directory is the directory what your visualization.js is currently located.

score:0

I have a few:

  1. try putting the './visualization.js' in src.
  2. Check the spelling.
  3. Put this line at the end of the tag.

score:0

You can use an npm package assets.

After using it you may use method resolver.path().

Now, instead of writing this:

var url = '/assets/images/icons/create.png';

You can write this:

var url = resolver.path('icons/create.png');

score:1

It sounds like you're running the server from a different working directory to where the HTML/JS files are stored. If you have this directory structure:

app
 └── static
      ├── index.html
      └── visualization.js

... and you've launched the server from the app directory, then the browser will be looking for visualization.js here:

app
 ├── static
 │    └── ...
 │   
 ├── index.html
 └── visualization.js <-

Make sure you're running the server from the same directory which contains the visualization.js.


Related Query

More Query from same tag