Home > Enterprise >  Referencing in html to css and js files
Referencing in html to css and js files

Time:06-22

My css and js functionality dont load properly in VSC. When I go live, it seems that it cannot find the files.

project directory tree

only when I refer to it from the project root will it work in css.

from src/main/webapp/    <script src="src/main/webapp/js/darkmode.js" type="text/javascript"></script>

in Intellij and Heroku web deployment it works from the webapp root:

from webapp/    <script src="/js/darkmode.js" type="text/javascript"></script>

The same applies to .css files.

And then I am not even talking about referring to REST resources on heroku, as this will work on tomcat local but not on heroku web with the same adress.

CodePudding user response:

You can use drag and drop mouse files from project to working file

CodePudding user response:

It seems my problems in vsc where down to loading in a larger project with Java, when I loaded only the webapp folder then things worked properly !

  • Related