News for hackers. Stuff that matters.
Re:How to Hack APIs in 2021 by tannhaeuser on Tuesday August 10, 2021 @10:59AM (#28129657)
Why do you write <img/> in authoritative tone? It's not 2000 anymore where we pretended XHTML or polyglot HTML is a thing. It's particularly odd to see that old cargo cult idiom (or, worse, with additional random spaces) used in a post lecturing users about HTML5-era SPA supremacy.
Re:How to Hack APIs in 2021 by capableweb on Tuesday August 10, 2021 @06:21PM (#28135456)
I don't know what you mean, self-closing tags are part of the HTML (5) standard: https://html.spec.whatwg.org/#self-closing-flag
Re:How to Hack APIs in 2021 by wizzwizz4 on Tuesday August 10, 2021 @11:18AM (#28129871)
? What's wrong with XHTML? <img /> is clearer than <img> for anyone familiar with XML, and XHTML documents are easier to parse (e.g. can be processed with XSLT stylesheets).
Re:How to Hack APIs in 2021 by tannhaeuser on Tuesday August 10, 2021 @12:11PM (#28130619)
Nothing wrong with XHTML per se (did an internal site using XSLT in early/mid 2000s), but XML/XHTML has been on the way out for the better part of this millenium on the web at least. If you're developing web content and/or browser apps, you should know HTML IMO, and XML is the least of your concerns. Not looking forward to apps mixing XSLT and JavaScript ;)

Can't stand "<bla />" though with that pointless/clueless space. The only place where I've encountered these are older JSP, FreeMarker, or Thymeleaf/Spring MVC apps (ugh).

Re:How to Hack APIs in 2021 by debaserab2 on Tuesday August 10, 2021 @12:28PM (#28130831)
JSX (React's default markup language) expects all tags to be closed, and self closing tags are valid. If you spend a significant time writing React apps (with JSX) then it becomes pretty second nature to write self closing tags. It's not exactly XHTML (I can't think of any other of XHTML's idioms it uses).