Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda