How can I load a js script when I start the phoenix server (iex -S mix phx.server). It will load only after entering the index page. I don’t need to enter the website but I have to use the functionality of the js.
Phoenix doesn’t have anything to do with JS.
- node/npm is used as tooling for building assets used by the page inside the browser (and some development support like live reloading).
- Other than that JS files are sent to the browser for execution.
Maybe this might be of interest: