3 ms·
Me too. Also, knowing that the DOM will be structured as I intended it to be is a good thing...especially when traversing/manipulating with JS. There is an HTML
by jqm0 17y ago
Me too. Also, knowing that the DOM will be structured as I intended it to be is a good thing...especially when traversing/manipulating with JS. There is an HTML5 parser that will tidy up those omissions but I doubt that will be implemented consistently across all browsers.
Leaving the browser to tidy up after you is IMHO bad practice.
- axod 17y ago>> "especially when traversing/manipulating with JS" The DOM is great. It's a pretty well designed API, and makes things easy. HTML/XHTML are just crappy ugly serializations of it. It'd be nice if there were some alternative serialization schemes supported by browsers more like JSON. If you're manipulating the DOM with js, then you can't far wrong. You can't omit closing tags. You can't have invalid nesting. You can't typo closing tags. etc
- ilyak 17y agoThe W3C DOM API is a nightmare. Every of them.
- daleharvey 17y agothe dom is a terribly designed api, it has to be one of the worst apis I have ever used to change a nodeName, you have to clone its children and replicate its attributes. to delete on object, object.parentNode.removeChild(object); to insert after an element object.parentNode.insertBefore(newObject, object.nextSibling); and that only works by auto'magic' nonsense. things like jquery would still be around if the browser all implemented everything nicely because the dom api is just terrible