News for hackers. Stuff that matters.
Re:A guide to understanding HTML APIs by pwdisswordfish4 on Friday October 16, 2020 @04:28AM (#24798805)
How can HTML have APIs if it’s not a programming language?
Re:A guide to understanding HTML APIs by tsujp on Friday October 16, 2020 @04:56AM (#24798945)
It's at the top of the article, and also the correct explanation of such:

  In an HTML API, the definitions and protocols are in the HTML itself, and the tools look in 
  HTML for the configuration. HTML APIs usually consist of a certain class and attribute patterns 
  that can be used on existing HTML.
HTML is just markup. You're familiar with markup if you've ever used a hilighter for instance. To make it an API just have something parse that markup according to some well-defined set of rules and to do _stuff_.

I can write a parser that accepts a single API call as it were:

  <p data-do-a-thing>Smith</p>
Now I can feed that into the parser and in this API of mine a `p` tag with attribute `data-do-a-thing` renders the contents of the tag prefixed with `Hello, ` giving `Hello, Smith`. Viola an API via HTML.
Re:A guide to understanding HTML APIs by joemaffei on Friday October 16, 2020 @09:28AM (#24800610)
The only one on the list that can be called an HTML API is drag and drop. All the others are Web APIs. https://developer.mozilla.org/en-US/docs/Web/API
Re:A guide to understanding HTML APIs by mpweiher on Friday October 16, 2020 @04:51AM (#24798918)
2nd paragraph:

"There are arguments that HTML5 as a markup language does not have programming interfaces; instead, these APIs are JavaScript APIs with formatted HTML responses."