Replace Your Ajax Jquery With Fetch in Laravel Projects
5 days ago
In my many projects i using jquery and laravel because it more familiar for and have ton of tutorial in internet. But when after i got project using modern frontend like vue, fetch is more uses. Then i decided to move bunch of my existing project using jquery with fetch.
I actually no have problem with jquery but only sometime got issue incompatible jquery and another library when i add another library that dependend with jquery spesified version this is a kind annoying.
This some benefit you get when http request using fetch instead of jquery.
- Modern native javascript API.
- No more dependency needed.
- Support for all modern browser.
- More cleaner syntax cause using async await.
- More familiar if you want to migrate to modern frontend library like react, svelte or vue.
This is example if using fetch