News for hackers. Stuff that matters.
Re:Why It's Time to Sunset jQuery by grannyg00se on Sunday April 14, 2013 @03:16PM (#5547894)
Your jQuery:

  $(document).ready(function() {
    $.ajax({
      url: "test.html",
      context: document.body
    }).done(function() {
      $(this).addClass("done");
    })
  });
Without jQuery:

  var oReq = new XMLHttpRequest();
  oReq.onreadystatechange = function() {if (this.readyState === 4) {
     window.document.body.className += " done";
  }};
  oReq.open("GET", "test.html", true);
  oReq.send();

Screenshots (blue indicates successful ajax):

without jQuery: http://browsershots.org/http://evening-harbor-8654.herokuapp...

with jQuery: http://browsershots.org/http://evening-harbor-8654.herokuapp...

Re:Why It's Time to Sunset jQuery by neya on Sunday April 14, 2013 @03:47PM (#5547989)
Your code is fine for this use case. But I'd have to bite my nails hoping it would work on browser 'X' for other use cases, which is simply not worth the headache. Cross browser compatibility is a real pain, you know? For me JQuery does it very well.

And good luck using your new ajax function :)

Re:Why It's Time to Sunset jQuery by Offler on Sunday April 14, 2013 @04:38PM (#5548183)
Drop support for old IE browsers, why are people still trying to fight to support them. I agree with the blog post, one day people will finally drop support for non-HTML5 browsers (IE8 and below) and they will see how easy it is to write clear, short native code that works fine in all browsers.

It will take time though as many people aren't even familiar with the native APIs.

Re:Why It's Time to Sunset jQuery by bjxrn on Sunday April 14, 2013 @04:51PM (#5548241)
You want to know why people worry about older versions of IE? Because a large enough chunk of their visitors still use those browsers. It's that simple.
Re:Why It's Time to Sunset jQuery by WA on Sunday April 14, 2013 @03:50PM (#5548003)

    $.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?
Re:Why It's Time to Sunset jQuery by shuzchen on Sunday April 14, 2013 @04:25PM (#5548123)
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.
Re:Why It's Time to Sunset jQuery by grannyg00se on Sunday April 14, 2013 @04:55PM (#5548262)
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.