News for hackers. Stuff that matters.
Re:Ask HN: What can JSON do that HTML can't? by tony-allan on Monday January 25, 2021 @08:55AM (#25903098)
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.

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.

https://developer.mozilla.org/en-US/docs/Web/HTML/microforma...

Re:Ask HN: What can JSON do that HTML can't? by pharzan on Monday January 25, 2021 @09:09AM (#25903237)
None of them alone can'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's.
Re:Ask HN: What can JSON do that HTML can't? by getcrunk on Monday January 25, 2021 @10:26PM (#25912125)
If your primarily moving and manipulating that data imo json is easier to work with (less loc)
Re:Ask HN: What can JSON do that HTML can't? by speedgoose on Monday January 25, 2021 @09:45AM (#25903653)
Be easily parsed.
Re:Ask HN: What can JSON do that HTML can't? by jetti on Monday January 25, 2021 @12:25PM (#25905958)
Is there really any difference is ease of parsing when given two properly formed documents of each type?
Re:Ask HN: What can JSON do that HTML can't? by a-saleh on Monday January 25, 2021 @12:32PM (#25906046)
Yes, json is so much simpler. Afaik, that is the reason for its popularity, even XML can be too much (especially as you browse the list of vulnerabilities in parsers).
Re:Ask HN: What can JSON do that HTML can't? by solus_factor on Monday January 25, 2021 @08:39AM (#25902961)
Be smaller.