Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Failing to load script files in target page after window.open()

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".

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!