|
Does `cash` support jQuery-style `.ajax`? When you consider replacing `$.ajax` with fetch, you'll quickly found out that fetch is severely lacking with regards to: * handling cookies, * HTTP status codes (404, 403, etc), * CORS, * and even just simply readability when dealing with JSON. jQuery's ajax (and its aliases like $.GET) handle all of these (edge cases? are these really edge cases?!) with aplomb, so you don't have to worry about it. This is the issue with all of the jQuery alternatives, even cash (which does look pretty awesome); you start using them, and then development hits a halt because you suddenly realize that you actually need something that jQuery already does quite nicely, and has done so, quietly and politely, for more than a decade. |
- handling cookies
- HTTP status codes - CORS - JSON handling I've used all of the above patterns regularly for several years now and never found any of them particularly cumbersome and certainly not lacking feature wise. If async/await syntax is available to you, it's even more succinct than the Promise style above.With that said, I've not used $.ajax in anger for a good long while so I may be missing out, particularly as I note there have been API changes in newer versions of jQuery. Are there some specific use cases that you've found fetch to be particularly inept in dealing with?