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

274
Visualizações
Why is my script src pointing me to localhost:5000?

My Console

Hello lovely developers! I am experiencing a problem with trying to house my javascript file separate from my .ejs files. In this example, I am point my script tag to "../client/index.js" and I know for a fact this is the location of my javascript file. BUT in this case it thinks I am pointing to localhost:5000/client/index.js when it should be pointing to the files in my internal file structure.

I have never experienced an issue like this. The weird thing is when I follow the link is VS code, it takes me to the correct file location. The problem only occurs when the link is present in the browser. I've tried doing some research on correctly orienting script tags, and I cannot for the life of me find out how to get this working.

Thank you so much your time, I appreciate it!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

../ means "Go up one level".

You are using it when you are already at / so there isn't a level to go up.

The ../ is therefore discarded.

It would be a security problem if you could craft a URL that would go above the server root and access any files on the computer running the website.

If you want to access the JS file then you will need to put it somewhere where it has a URL, and then use that URL.

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