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

111
Visualizações
Javascript not functioning when conducting local testing

Good Morning/Afternoon/Evening all,

I'm working on developing a fairly simple webpage, I have index.html setting up the appearance of the page and in the header I have a link to a js file:

<script src="toOutput.js"></script>

Later on I have a button that's linked to a function in the js file:

<input type="button" id="update" name="update" value="Update" onclick="getInput()"><br>

I know the connection between these function is set up correctly because I have it running publicly on a separate system while I continue development. However, as I'm trying to conduct further testing locally for the life of me I cannot get the javascript to run. I've tried using the npm module http-server to host and I can navigate to the page which appropriately pulls and uses style.css, and if I view the source code I can click on toOutput.js and I see the code, but when I click the update button the code doesn't run. I've also tried using 'python3 -m http.server 8000' again I can see the page and style.css loads, and the javascript is there, but won't execute. Finally I tried copying the environment I have set up running the page publicly which uses apache2 and points at the appropriate directory. Once again, I can navigate to the page when I use this method, all the code is there, and still the javascript does not run. I've also cleared the cache in the browser a bunch of times and tried other methods for calling the javascript, like adding an event listener within it, none of it has worked.

What am I missing?

about 4 years ago · Juan Pablo Isaza
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