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

75
Vistas
Fetch locally stored file with Javascript

My browser will display HTML files stored on my computer, and allow them to link to local stylesheets/scripts. It will also display text files. However, it seems like I can't use the Fetch API to access these. Is there any workaround for this?

This is what I have:

fetch('file.md')
    .then(response => response.text()
    .then(text => {
        let target = document.getElementsByClassName('content')[0];

        let converter = new showdown.Converter();

        converter.setOption('customizedHeaderId', 'true');
        converter.setOption('tables', 'true');

        let html = converter.makeHtml(text);
        target.innerHTML = html;
    })

It works fine accessing a normal Internet file.

about 4 years ago · Juan Pablo Isaza
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