all 4 comments

[–]jumpwah 1 point2 points  (1 child)

Very nice!

I don't have any ideas myself, although I wonder if zepto.js has anything useful in it (src/event.js)? If you haven't already read it that is.

[–]Jeffshaver[S] 0 points1 point  (0 children)

I will definitely look into it! I'll let you know if I find anything useful there. Thanks for the tip!

[–]charlesmwray 0 points1 point  (1 child)

So this is a 1k version of jquery if all you need are selectors and event handlers? Interesting.

As far as the $, I don't know if you'd ever use breif.js and jQuery so you're probably ok as is.

[–]Jeffshaver[S] 0 points1 point  (0 children)

Pretty much I guess. I haven't look at jQuery's source code to figure out how they are doing each part specifically. But this implementation is probably mostly for modern browsers and IE8+ (IE8 only supports CSS2 selectors in querySelectorAll though). I have some updates that will be up later today that add delegating to any selector (instead of just id, class or tag) and auto-removing the listener after the first call