Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
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 answers
Answer question

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 Report

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 Report

0

Correct your spelling. scr should be src.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!