Re:HTML.js – Befriend the DOM
by maxhowell on Tuesday August 13, 2013 @09:22AM
(#6205510)
What does Hacker News recommend as a standalone AJAX solution nowadays?
[ Parent
| on HN ]
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.
Re:HTML.js – Befriend the DOM
by prezjordan on Tuesday August 13, 2013 @12:31PM
(#6206700)
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.
Re:HTML.js – Befriend the DOM
by prezjordan on Wednesday August 14, 2013 @12:39AM
(#6209956)
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...
If you are a node.js user, these libraries have familiar APIs:
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.
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.