re: A JavaScript-Free Frontend VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 

Well AFAIK you aren’t told, even in the console, whenever there’s mistyped HTML. So while you are mostly right, I still think there should be an error or warning when something’s wrong.

Html is entirely declarative, and there are plenty of validators out there, often built right into the IDE.

While I agree it might be nice for browsers to put something in the console when they encounter unrecognized tags or attributes (and I think some of them might already do this), I still think a silent best-efforts approach by the browser is a way better experience for users than a blank page with a hidden stack trace.

I’d prefer a best-efforts approach with a console error, which I wouldn’t consider hidden, just placed where the average user wouldn’t find it.

That's the crux of this whole argument, though: an unrecognized tag is not an error. Because Html tags are not instructions to be followed like an imperative program. They are semantic expressions of document structure, intended for a variety of potential clients of differing capabilities. Different browsers (and other devices) are free to interpret parts of those declarations they understand, and ignore others. Html documents can be full of tags and attributes, meant for specific clients, in different contexts.

By design, browsers are supposed to ignore anything they don't recognize. If they wrote errors to the console for every bit of unknown content, the console would be very noisy indeed.

This seems to be a hard concept for many to grasp.

You can filter console output, atleast in Firefox.

code of conduct - report abuse