Get the latest tech news

Why can't HTML alone do includes?


Is there a perfectly clear and reasonable answer? Or could we get this someday?

Our developer brains scream at us to ensure that we’re not copying the exact code three times, we’re creating the header once then “including” it on the three (or a thousand) other pages. I’d wager (counts fingers) pretty much all websites need this ability, and all of them reach for different additional non-web-standard tooling to get it done. Like for whatever reason it’s cool to load images and CSS and JS from other domains, but HTML would likely be restricted.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Answer

Answer

Photo of HTML

HTML

Related news:

News photo

Mark Zuckerberg Thinks You Don't Have Enough Friends and His Chatbots Are the Answer

News photo

Fedora 42 has the Answer, but Ubuntu's Plucky Puffin isn't far behind

News photo

TikZJax: Embedding LaTeX Drawings in HTML