4 ms·
> Of course if you load a bunch of code beforehand your code will be marginally better. That's exactly the point though. We use jQuery because it has an incred
by peebeebee 3y ago
> Of course if you load a bunch of code beforehand your code will be marginally better.
That's exactly the point though. We use jQuery because it has an incredible easy and consistent interface that makes writing for the web so much more enjoyable. Selectors, events, chaining,... are all just nicer to work with than the vanilla counterparts. Same goes for all libraries and frameworks. :)
BTW: Your example is sending a "multipart/form-data". Not all API's will understand this, and will need JSON anyway.
- lakpan 3y ago> Not all API's will understand this Who’s talking about APIs? Most jQuery users I know just use jQuery to submit forms and load some JSON, both of which are covered by fetch without altering the headers manually. What I’m saying is that it’s not fair to judge a tool for something you don’t have to do with it, namely sending JSON for everything. Fetch also supports native binary uploads, whereas most people base64 data when using $.ajax > makes writing for the web so much more enjoyable Writing? I agree. Actually making it work? No way. $('forn').hide() doesn’t work, but the browser will never tell you why (hint: wrong selector). jQuery errors are often silent, and that’s good enough reason to abandon it.