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

The first example is not really apples to apples as it doesn't even have error handling which makes the native function look longer. Probably because getJson doesnt support errors by default and you have to use promises http://api.jquery.com/jquery.getjson/

I ran into this issue of jquery silently failing a while ago and will always remember that pain point



I don't think I've ever used getJSON(), only ever the longer form ajax(), and never had issues with error handling, well at least since jquery 1.9 when deferred promises came good. Using .then() to chain events together is very smooth, what I always wanted. I'm lightweight with JS mostly though!




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

Search: