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

264
Views
Running fetch API in local windows machine by using visual studio code

I am totally new to web development if somebody can help me to start to use Fetch API. Can I run the HTML and vanilla JS (with JS Fetch API functionality) on my windows computer? I was looking around and found visual studio code and a live server. It looks like it can load the page on the server but still, it is not clear what kind of JS library I should include for enabling Fetch API. I just want to execute the following code on my laptop (would be nice if I don't use any JS library though I am not sure if it is possible or not)

<script>
let file = "fetch_info.txt"  //assuming the file is located in my server

fetch (file)
.then(x => x.text())
.then(y => document.getElementById("demo").innerHTML = y);
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The issue is that the fetch method needs a proper resource path, example:

fetch("cdn.example.org/files/fetch_info.txt")

Replace cdn.example.org/files/fetch_info.txt with the path of your file, in your case it would most likely be on localhost!

Read more about the fetch method on mdn

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!