I have a JavaScript file inside a folder structure a bit like this:
./JS/main.js
and i want to access a folder that is located here:
./img/img1.png
How would I be able to locate this image?
If you are using plain old js, then you can "go back a folder" with ..
In this case, it would be: ../../img/img1.png.
Otherwise, you should check out your framework's documentation on loading assets!