HN2new | past | comments | ask | show | jobs | submitlogin

    $.get('test.html', function(r) {
        window.document.body.className += " done";
    });
But: This is not about short code. It's about readability. What's readyState 4? Why "open" a request before sending it?


It gets even messier when you find out one day you have to handle failures, or serialize data to send to that endpoint, or get notified on network events, or cancel an ongoing request, or etc etc etc.


My code is a response to neya's comment. It's not about short code or readability. It's about demonstrating that neya's example has completely unreasonable non-jQuery code given the jQuery code it is being compared against.




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

Search: