TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What can JSON do that HTML can't?

3 pointsby drzelover 4 years ago
Just wondering, if HTML is indeed a data format, with some extra rendering stuff as a bonus, is there anything that JSON can do that HTML can't?

5 comments

tony-allanover 4 years ago
They are both just data formats. HTML, derived from XML, is a data format that can be read by the browser to display information to users; JSON is data format that can be read and written by almost every programming language, including JavaScript running on a server or in a the browser.<p>HTML is just as capable of storing data, for example microformats. In practice though, it is easier to use HTML to describe the contents of a web page for a user and JSON to exchange data between programs.<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;microformats" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;microforma...</a>
pharzanover 4 years ago
None of them alone can&#x27;t do anything and they are used for total different purposes. You can organize the data in a way to include the same information stored in the data&#x27;s.
getcrunkover 4 years ago
If your primarily moving and manipulating that data imo json is easier to work with (less loc)
speedgooseover 4 years ago
Be easily parsed.
评论 #25905958 未加载
solus_factorover 4 years ago
Be smaller.