Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

So I guess I'll be the first to ask the obvious question. How is this different or better than jQuery?


It doesn't wrap and extend dom elements, just finds them, so there's no $(this) etc just to be sure all your objects behave the same way, no .attr('id') to get attributes etc. It also has a nicer syntax I think, like the idea of doing HTML.body.ul.li.a So it looks interesting, though I wish they had included Ajax.

This doesn't do everything jquery does, and is not intended as a drop-in replacement, more as a different way of doing things which is simpler, smaller and more intuitive.


What does Hacker News recommend as a standalone AJAX solution nowadays?


I've used superagent (https://github.com/visionmedia/superagent) a number of times and it's wonderful, but beware if you're trying to make it work with old IE.


Geez, has he made everything?


yes, he has. as has substack. basically everything.

but part of the reason they are so prolific is that they focus on very small, single use modules that do one thing well. So they have hundreds of repos, but many of them are 10 - 15 lines of code.


That may be one reason, but the guy's responsible for Express, Jade, Mocha, Commander, and many others. I honestly thought visionmedia was a company until a few months ago.


i did too, the sheer volume of useful code he ships is incredible.


Not sure if it is a complete replacement, but I needed to remove a dependency on jquery recently and used this code:

https://github.com/inkling/backbone.native/blob/master/backb...

The $.ajax function was all I needed.


Just using the native XMLHttpRequest has pretty good support: http://en.wikipedia.org/wiki/XMLHttpRequest#History_and_supp...


The node-inspired `http-browserify` is my favorite; really nice, sane syntax for doing ajax requests that you can mix with client-side streams and transforms to do really advanced things with code that is clear and readable. Of course you have to use browserify to use it, but it's worth looking into.


If you are a node.js user, these libraries have familiar APIs:

https://github.com/substack/hyperquest

https://github.com/iriscouch/browser-request


Reqwest (https://github.com/ded/reqwest) has worked well for me, and has EnderJS support too. The API is similar, but not identical, to jQuery.ajax.


There is a small FAQ in the bottom.


"Not so much. This doesn't wrap or hide the DOM for you. It exposes and enhances it, making it your ally instead of trying to protect you from it. Old IE versions are fading; it's time to go native!"

This seems like a pretty poetic way of describing differences between software packages. And I mean that in a non-charming way.


I red the faq... didn't really answer my question... from the examples I saw, there was nothing there that ouldn't be achieved with JQ...which is why I brought it here...thought maybe I was missing something.


Well... everything could be achieved with JQ. Usually with 1 line of code. But that library is 2.7k and you're working directly with the DOM elements and not with wrappers. So I guess it could come handy for smaller projects where you wouldn't need the full JQ power and 10 JQ widgets.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: