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

192
Visualizações
Html cannot load javascript?

I'm sorry about the fact that I'm a newbie, if the question is not clear, please notify me again, I will add information. I have a sample code , but it cannot load js. Can someone tell me how to solve?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="/js/signalr.js"></script>
    <script src="/js/Cnn.js"></script>
    <title></title>
</head>
<body>
    <h1>Qoo</h1>
</body>
</html>

the error:

Failed to load resource: net::ERR_FILE_NOT_FOUND

enter image description here

enter image description here

And I have try this way,but it still cannot work

<script src="/wwwroot/js/signalr.js"></script>

or

<script src="~/js/signalr.js"></script>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It all depends on where the HTML file is, relative to the JS file.

If the index file is in the root of that folder and the JS in a sub-folder, the correct code would be:

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

The above code uses a relative URL as does your code however, your code is relative to the root directory and my example is relative to your current working directory.

If your URL in the browser has a driver letter at the start of it, then the JS would be loaded from a JS sub-folder in the root of that drive. For example, if the URL is C:\wwwroot\index.html then the browser would attempt to load the JS file from C:\js\signalr.js rather than C:\wwwroot\js\signalr.js, where the latter is the correct location.

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