I am not a front-end developer but looking at it from a distance I really don't get modern web design. Sure some sites might need fancy javascript single page features, like if your webpage is an interactive map or realtime game, but most sites are just text and some pictures. Whats with all the javascript? Your site looks just like the next one anyway! It feels like an "Emperor's New Clothes" situation or maybe more…
I agree with you. It definitely does not serve the user. I have two thoughts, as a nobody. 1. Ads/trackers/etc. need javascript 2. It's a way of flexing and saying "we have resources to put into this webpage which makes us a serious business." Any other thoughts?
- Toggling widgets such as menus, modals and other things you only want to show when the user requests it. This includes updating accessibility related HTML attributes.
- filtering, sorting etc. of larger data sets in the client.
- live updates of fresh, time related data
- search that doesn't force a complete reload, via AJAX or cached on the client.
- smoother page / content transitions via AJAX
- everything related to forms / user input: you want to instantly react
- managing and preserving state / context per user
- visualizations / graphs that are explorable / interactive
- polyfills for older browsers that don't support optimizations such as lazy loading.
- interactive widgets such as chat boxes (not a fan but still)
- testing and analytics
A website isn't made of paper.