10 ms·
Other than the historic messiness the other comment raised, the DOM API is just... not good. I don't think it's surprising developers don't want to bother with
by mediumdeviation 5y ago
Other than the historic messiness the other comment raised, the DOM API is just... not good. I don't think it's surprising developers don't want to bother with fun stuff such as
- The only way to remove a node is node.parentNode.removeChild(node), until you get past IE11 then you can use Element.remove() https://developer.mozilla.org/en-US/docs/Web/API/Element/remove https://developer.mozilla.org/en-US/docs/Web/API/Element/rem...
- Text node normalization - because there are separate representation of the exact same HTML https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize https://developer.mozilla.org/en-US/docs/Web/API/Node/normal...
- NodeLists are almost but not quite arrays. They could also be live or static but you can't inspect it directly to tell which is which https://developer.mozilla.org/en-US/docs/Web/API/NodeList https://developer.mozilla.org/en-US/docs/Web/API/NodeList. Similar almost-array nonsense with HTMLCollection.
- Historically IE and Netscape/Firefox supported two completely different set of API and it was a horrible mess. You can still see remnants of that API war in functions that does almost but not quite the same things such as textContent vs. innerText https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#differences_from_innertext https://developer.mozilla.org/en-US/docs/Web/API/Node/textCo...,
- austincheney 5y agoMaybe arguments of IE insanity were once vaguely qualified because it took an extra step of testing and learning, a straw that breaks a camels back. IE is dead now, years past sunset and about to be eliminated in June 2022, so these arguments no longer apply. The fear and insanity remain nonetheless.
- Zababa 5y agoYears past sunset? At work we have customers that use IE every day. These arguments certainly still apply, especially since IE isn't even EOL yet.
- austincheney 5y agoMS sunset IE in November of 2018. Security maintenance ends in June at which point IE will become a security threat and remains a core OS component (according to MS). At any point after MS can forcefully remove IE with a patch.
- Zababa 5y agoSo IE is still here and we have no idea when it will stop being here (since companies also have to update).