Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda