5 ms·
The Bad: The premise of the examples list seems a bit disingenuous. Very few of these things take into account the full convenience of jQuery. It's much more
by chavesn 13y ago
The Bad:
The premise of the examples list seems a bit disingenuous.
Very few of these things take into account the full convenience of jQuery. It's much more than saving a couple lines of code or knowing the native way to accomplish the most basic version of a task. jQuery's real benefit is preserving simplicity as your needs grow more complex.
Right off the bat I feel like the getJSON[1] example is a bit simplistic. Almost anyone using ajax needs to serialize data, handle errors, prevent caching, etc. jQuery has thought about all this[2].
Don't get me wrong -- most of my work has been without jQuery, but that means I know exactly how much work it is.
The Good:
The format is a nice way to show people (who really don't know otherwise) the native JS plumbing.
"The number of people who don't know that jQuery != Javascript is too damn high". So to help combat that, I really appreciate the idea behind this site.
It's great to show side-by-side how jQuery isn't "magic", since many people seem to learn jQuery these days without even knowing the first thing about Javascript, but I just think it should be presented with a slightly different premise.
[1]: http://youmightnotneedjquery.com/#json http://youmightnotneedjquery.com/#json -- side note, why did they set the handler after the `send`? It seems like that could cause problems if the result was returnable quickly, such as from cache, though I haven't tested it.
[2]: http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings
- ep103 13y agoright off the bat its wrong, IE8 doesn't include JSON support unless you're in strict mode.
- sfeng 13y agoYou have it a bit backwards, IE8 doesn't include JSON support when you are in quirks mode, which no modern application should ever be in.
- sanderjd 13y agoThat's a great point - this is really awesome as a "learn the essence of what jQuery is doing for you!" and a little annoying as a "you don't need jQuery!".
- Kudos 13y agoI took the tone as being directed to people publishing plugins that use jQuery for 1% of its functionality, forcing people not using jQuery to either not use that plugin, rewrite the plugin or include jQuery. Edit: it actually literally says it's for library developers.
- ufmace 13y agoFor 1, I was wondering about that too - it seems like such an odd thing to do. Who knows what the latest JIT-y stuff and cached responses could do to how fast things run? Just set it before you send, like any normal developer would, and get rid of the need to worry about it.