4 ms·
History API is one of worse thing introduced to web. And it is only created to cater to the SPA developer who don't want to see # tag in their URL. With the all
by postdb 4y ago
History API is one of worse thing introduced to web. And it is only created to cater to the SPA developer who don't want to see # tag in their URL. With the all the APIs in HTML5 I think we ought to take a step back and get ride of some these.
- welder 4y agoThe History API is super useful, not sure why you don't like it. For ex: I can load some data from API, update the url with History API, then if the user refreshes the page they get the correct url but I just saved them a ton of bandwidth and time by not having to refresh the whole page.
- pfoof 4y agoit's not about history API being bad, it's about misuse to push the same url 1000 times onto the stack to the back button doesn't work
- welder 4y agoI've never seen that done, sounds like a bug in the website because there's not reason to do that. It's also an easy fix: close the tab and don't use websites that do that.
- welder 4y agoYou can choose to update the history stack or not. For example, this page uses the History API to update the url without changing the browser history stack: https://wakatime.com/pricing https://wakatime.com/pricing Click the toggle to show yearly pricing and the url is updated, but you can still press back to go to whatever previous page you visited. Then, this page DOES update the history stack when the url changes: https://wakatime.com/dashboard https://wakatime.com/dashboard Click the date range and select a new range, notice the url changes but also you can press back to go to your previous date range.
- postdb 4y agoIt breaks the expectations user have about browser. It is very snaky way to try to make a browser what it is not, all in the name of making SPA just to make a trend. It is one of thing most annoying about the IT industry, that it is a more about fashion then about tech.