I am using webstorm to open my webpages.
Basically, I have a customers.js that contains window.open("../customers-form.html"), and customers-form contains a script with src="./scripts/customer-form.js".
When I open customers-form.html directly, the script runs fine, but there is a problem with accessing it through window.open() from the other file.
GET http://localhost:63342/scripts/customers-form.js net::ERR_ABORTED 404 (Not Found)
Thank you for your time!
EDIT:
I noticed that the link when I am in customers.html is localhost:63342/WDF/customers.html, but localhost:63342/customers-form.html after window.open(). This probably is the problem, but I have no idea how this can be fixed. For some reasong, webstorm is loading customers-form.html outside of its parent folder WDF.
EDIT 2:
I fixed it by using location.href = "../../WDF/customers-form.html".
Since I was calling location.href (or windown.open()) from a javascript file, I thought that the current directory is that of the same file, not of the html document, but I was mistaken. Those calls go back to the html document.