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

265
Vistas
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 Respuestas
Responde la pregunta

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 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