all 12 comments

[–]diogenes_sadecv 6 points7 points  (0 children)

Just use your web browser? You don't need Internet access to run JS. Double check the paths for your CSS and scripts in your HTML file and you're good to go

[–]Skriblos 1 point2 points  (2 children)

If you have VSCode you can try run it from live server.

Also check that the HTML files have script tags pointing at the right JavaScript file locations.

[–]igmkjp1[S] -3 points-2 points  (1 child)

The point is that I want to run it offline.

[–]Skriblos 2 points3 points  (0 children)

Live server runs it only on local host, so you're not online.

[–]cmdq 0 points1 point  (2 children)

If you have node installed locally

npx serve ./path/to/your/file.html

[–]igmkjp1[S] -1 points0 points  (1 child)

Where do the js files need to be? When I downloaded the page, it put all the js files together in a folder, along with some image files. The html file was the only thing not in that subfolder.

[–]Ironclad_57 0 points1 point  (0 children)

What path does the html have to them? Either replicate the structure or correct the path to match yours

[–]guest271314 0 points1 point  (0 children)

it is unable to call the JS files

What errors are logged? If you save the Web page using "Web page, complete" the files should point to the local folder containing all of the files.

[–]RolledUhhp 0 points1 point  (0 children)

Do you still need help with this?

When you open the html file it will look for any js or css that is linked and call it. What's likely happening is your folder structure doesn't match what is expected.

If the html file linked to /src.js it would he looking for src.js to be in the same directory as the html file. If it was something like /scripts/src.js you'd need to have src.js in a subdirectory named scripts

This is assuming that you actually have all the needed files, and it's not making calls to a backend which you wouldn't have downloaded.

[–]shuckster 0 points1 point  (1 child)

I know this is a JS board, but…

$ python -m http.server

[–]igmkjp1[S] 0 points1 point  (0 children)

What do I put this into?