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

229
Views
JavaScript path doesn't load on Live Server extension (VS Code)

HTML and CSS files are working perfectly on my live server. But every time I lead to a .js script it will not be shown on my live server. If I try to load the .js file directly through the URL it shows "Cannot GET /line.js". I already tried out everything I've found on the internet but it's still not working. Here are the points I checked/did:

Installed Code Runner

Installed Node.js = node.js system path done

Settings = Live Server Config = specified browser

"liveServer.settings.CustomBrowser": "chrome" on JSON settings

.js file is in a separate folder and accessed via <script src="line.js"></script> on index.html

Chrome is set as default browser on my system

Thanks for your inputs.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If the js file is in a separate folder, you need to provide the exact route to the folder in the script tag, since in the current form it is trying to find the js file in the root directory. The script tag should look like this:

<script src="FOLDER_NAME/line.js"></script>
about 4 years ago · Juan Pablo Isaza Report

0

It's possible that your javascript file is being loaded before the HTML page is rendered. You can try adding "defer" to your script tag like this:

<script src="demo_defer.js" defer></script>

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!