Search code examples
javascripthttp-status-code-404

How to solve GET http://localhost/assets/js/leaflet-indoor.js net::ERR_ABORTED 404 (Not Found)


I am making a leaflet map, it's all working. Then I decided to run it through localhost in htdocs. But the script is not working and I get this 2 error:

GET http://localhost/assets/js/leaflet-indoor.js net::ERR_ABORTED 404 (Not Found)

GET http://localhost/data/fvrFloor.json net::ERR_ABORTED 404 (Not Found)

Here's how I import the files:

<script src="/assets/js/leaflet-indoor.js"></script>
<script type="text/javascript" src="/data/fvrFloor.json"></script>

And here is my project structure:

My Project Structure

leaflet-indoor.js is located inside js folder while fvrFloor.json is located inside data folder.


Solution

  • I need to add my main project folder in the src attribute just like this:

    /nav_system/assets/js/leaflet-indoor.js