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

173
Visualizações
Problems with Javascript code in html file

Code:

<!DOCTYPE html>

<head>
  <script type="text/javascript" src="jquery-3.3.1.js">
  </script>
  <script type="text/javascript">
    $(function() {
      alert("Hello World");
    });
  </script>
  <meta charset="utf-8">
  <link href="../style/Home.css">
</head>

<body>
  <input type="text" name="username" placeholder="Username" id="user" />
  <input type="password" name="password" placeholder="password" id="pass" />
  <input type="submit" id="submitButton">
</body>

The html section of the code, like the input fields works fine, but the javascript portion has not been working. Originally I had it where the javascript portion of the code was its own separate file, but I ultimately had to change that when it wasn't working. Even after I added the javascript code to the html file the code still wouldn't run, so I just did a generic alert statement to see if the problem was with the javascript code or if it was something else.

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

0

in you browse press F12 > Network > make sure Disable cache has checked

you should type alert() only

<script>
   alert();
</script>

alert will still run even if jquery is not read

about 4 years ago · Juan Pablo Isaza Relatório

0

path to your jquery file is invalid.

<script type="text/javascript" src="jquery-3.3.1.js"> 

in src, you cannot give path like this: jquery-3.3.1.js. give proper path.

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