4 ms·
Can we just use links to go between pages, instead of toggling css display:none on custom elements to show different "pages"? You're replacing browser functiona
by lucb1e 1y ago
Can we just use links to go between pages, instead of toggling css display:none on custom elements to show different "pages"? You're replacing browser functionality with custom code. To get on par with browser default functionality, you need to implement a loading indicator, error handling, back/forward button handling, address bar updates, opening links in a new tab when someone middle clicked or ctrl clicked, new window when they shift clicked, etc.
https://plainvanillaweb.com/pages/applications.html https://plainvanillaweb.com/pages/applications.html This example code does exactly one of those things: update the address bar by setting the fragment identifier. Middle clicking and back/forward buttons work because of that. Error handling (if it were to not just be static content but actually loading something from a server like a real website, which can fail) and loading indicators are not present
Re-implementing browser code in JavaScript is not using the "plain" or "vanilla" web functionality. You're making your own framework at that point
- JodieBenitez 1y agoIndeed... I'd critisize SPAs a lot less if they wouldn't try to (poorly) mimic MPAs that often.
- zelphirkalt 1y agoAnd at that point of course we would see some 90% reduction of SPAs, and hordes of FE devs looking for work. There is non-technical incentive at work to keep this bloat in the boat.