4 ms·
Is SelectorEngine sizzle directly? I'm not sure how practical replacing jQuery is, and not going to look that deep. But jQuery isn't nearly as big today since
by tracker1 8y ago
Is SelectorEngine sizzle directly? I'm not sure how practical replacing jQuery is, and not going to look that deep. But jQuery isn't nearly as big today since most browsers (even IE11) are pretty modern.
- 9dev 8y agoA good replacement selector engine: `const selectorEngine = selector => Array.from(document.querySelector(selector));` :)
- fenwick67 8y agoIt needs to be querySelectorAll, and you need to handle cases where it returns null as well.
- 9dev 8y agoDarn, that's what you get from typing on mobile. Ment to use querySelectorAll originally. But apart from null handling (which can be solved using `|| []`), what else would be lacking? I used a similar version of this for a few projects a while back, with some additional stuff for query context and ID selector -> getElementById I think, but that's basically it...
- fenwick67 8y agoIt definitely works, I've written `document.querySelectorAll(x)||[]` many times. If all you're doing is making a few simple queries, it works fine.