4 ms·
This code would be a bit shorter and simpler if it dropped support for old browsers (specifically, Internet Explorer). Some examples: The functions hasClass,
by TheAceOfHearts 8y ago
This code would be a bit shorter and simpler if it dropped support for old browsers (specifically, Internet Explorer).
Some examples:
The functions hasClass, addClass, and remClass could be replaced by Element.classList [0].
Another one is remEl, which can be replaced with a direct call to ChildNode.remove() [1].
I was going to give more examples, but I don't feel like rewriting the whole script.
[0] https://developer.mozilla.org/en-US/docs/Web/API/Element/classList https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
[1] https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/r...
- masswerk 8y agoWhy should anyone invest lifetime to remove compatibility from a perfectly working application? Just to prove that not everyone is using an evergreen browser?