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

100
Views
Another way to display content from external file in html

I have a html file with a UL element. I want to load the LI elements for this UL from an external file that will be in the same folder as the html file. The external file can be any type of file. So .html or .txt, xml maybe? (preferably not JS)

Methods i've tried that work but why I don't want to use them:

jQuery load Works ofcourse but I don't want to use external libraries for a relatively easy request.

XMLhttprequest It's going to be a local very simple tool for co-workers, and this also seems too big of a request for just 10 li's.

w3 Include Same as XMLHTTPrequest

document.write I'm using document.write right now as a solution, but then the external file is a .js file. I rather have my coworkers work in a HTML or txt file plus i read a lot of negative stuff about document.write. And this file starts with: document.write(' - and i rather have the file start with the li's like < li > 1 < / li >

iframe or object I don't like how these tags append a whole new html and body tag to the UL and also styling is an issue.

php also to big of a step for just a local web application.

File reader also tried letting the user upload a txt file in a filereader. But I don't want the upload option

I probably tried more than the above solutions. But I just can't wrap my head around that this can't be done more easily or lightweight if the file is in the same folder.

Looking for a simple / easy solution if possible.

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

0

Native implementation of HTML Imports will be removed from Chrome 73 so it is now recommended to use native fetch(), or third-party libraries.

DEPRECATED look at https://www.w3.org/TR/html-imports/

<link rel="import" href="myfile.html">
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!