Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
Live server isn't running scripts

I'm on chrome on a Mac, and the index file runs but the script doesn't change anything. I tried just removing paragraphs and that doesn't work either. I tried hard refreshing and running from the Live extension.

This is the code from Index.html

<!DOCTYPE html>
 
<html>
    <head>
        <h1> I've a lot of things to do today.</h1>
    </head>
    <body>
        <p> 1. Get the litter & Wet Food.</p>
        <p> 2. Clean the Room.</p>
        <p> 3. Go out with the girlfriend.</p>
        <p> 4. Teach Rishabh.</p>
        <p> 5. Watch a show.</p>
        <p> 6. DON'T GET ANYMORE NFTS SER.</p>
        <script scr="scripts.js"></script>
    </body>
</html>

and scripts.js

let ps = document.querySelectorAll('p')
ps.forEach(function(p){
    p.remove()
})

The script isn't called at all because even a simple console.log statement in the scripts.js file won't run. No errors either :/

Thanks a lot for the help. I'm super new and this has been kinda frustrating.

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

Everything is perfectly Fine, but I would say you to not to use the h1 in the head tag.

  • The problem with the snippet provided is that there is a typo in the source definition of the script!
  • Use the correct definition for the source src in place of the scr.
<script src="script.js"></script>
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can't write h1 like this in head, head is used for meta-data, link, and other things to configure html page before loading. If you want, you can set a title in head to replace your h1 or move your h1 in your body. Rest of your content should be in body.

Edit : And you have a spell error, it's src not "scr" for import your script !

<html>
  <head>
    <title>To Do Page</title>
  </head>
  <body>
    <h1>I've a lot of things to do today.</h1>
    <p>1. Get the litter & Wet Food.</p>
    <p>2. Clean the Room.</p>
    <p>3. Go out with the girlfriend.</p>
    <p>4. Teach Rishabh.</p>
    <p>5. Watch a show.</p>
    <p>6. DON'T GET ANYMORE NFTS SER.</p>
    <script src="./scripts.js" type="text/javascript"></script>
  </body>
</html>

You may run a little console.log() for ensure your import is fine, before working on script like this, if the log, at top of the js file doesn't not appear in your console browser, the script is probably not imported.


console.log("test");

let ps = document.querySelectorAll("p");
ps.forEach(function (p) {
  p.remove();
});

about 4 years ago · Juan Pablo Isaza Denunciar

0

Correct your spelling. scr should be src.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda