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

73
Views
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
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!