Home > Software design >  how can I fix files that are not showing in my local website?
how can I fix files that are not showing in my local website?

Time:12-23

I created a pokedex project with html css and javascript,when I try to open it with VSCODE it works fine,but when I try to open the html local file the broswer doesn't find 2 local files, it keeps saying that:

file:///C:/assets/js/poke-api.js net::ERR_FILE_NOT_FOUND GET file:///C:/assets/js/main.js net::ERR_FILE_NOT_FOUND

the problem is that the files are working when I try to open in VSCODE.

enter image description here

Attempt to fix

Your code does seem to be using one method that works on my system, so I am surprised that you are getting an error. However why don't you try the other method that works on my system, and see what happens?

Remove the ./ when accessing the Javascript files, by changing

<script src="./assets/js/main.js"></script>

to this

<script src="assets/js/main.js"></script>

Please let me know how you get on, because I am curious too.

CodePudding user response:

I tried to run your pokedex project and it works fine form me. Here I upload the screenshot of pokedex project working perfectly fine see the screenshot

I am happy to see that you are doing such a great project. I am also fan of Pokemon. Keep it up.

  • Related