3 ms·
For you they must answer those questions. For some (like myself) these are enough. I don't need or want to load all of jQuery unless I'm using more than just DO
by adeaver 13y ago
For you they must answer those questions. For some (like myself) these are enough. I don't need or want to load all of jQuery unless I'm using more than just DOM selectors and manipulation. The projects I'm working on now all target the latest browsers so I don't care about IE 6/7 or backwards compatibility.
Yes, I could write one myself but this way I don't have to maintain the codebase. Nothing is a 'one size fits all' solution but for some this is a good start.
My point being don't dismiss it just because it doesn't fit your needs right now. It's still worth taking a look at.
- Recoil42 13y ago> I don't need or want to load all of jQuery unless I'm using more than just DOM selectors and manipulation. Then why not just use Sizzle, which is jQuery's core selector engine without all the extra fluff? Again, the same question applies.
- adeaver 13y agoSizzle is one of the engines we are checking out. Is HTML.js better? No idea. Worse? Same answer. HTML.js is still smaller (a huge factor for me right now) and less 'robust', but that isn't always a bad thing.
- emn13 13y agoBy the looks of it, HTML.js is worse than plain DOM. Try `HTML.body.div.section.ul` in the example on its homepage, for instance - I'm willing to bet that's not doing what you'd expect.
- adeaver 13y agoIt 'selects' all the section nodes. That's what .only() is for.
- nadabu 13y agoI'm hoping it returns undefined. Dot-traversal on a list goes into the first item, the first item should be empty. I have had some issues with the demo, since it hacks some things for presentation's sake. What did you expect?
- gbrits 13y agoisn't Sizzle just a selector engine? Just seems selector + manipulation
- lhorie 13y agoIf the amount of DOM manipulation you're doing is that light, and you don't care about IE7, you could just use .querySelectorAll()... (At least, you'd know what type it returns)
- dmethvin 13y agoIf you just need the selection/traversal/manipulation of jQuery then just make a custom jQuery build with that. If that is still "too big" then use the alternate (qSA minimally wrapped) selector engine instead of Sizzle. Instructions are in the README in the jQuery repo. The advantage of this approach is that if you decide you need more of jQuery (for example to support a plugin) you can pull in what you need rather than reinvent and debug your own.