3 ms·
Wait, can any webdevs explain a legitimate use for these features? Because my (admittedly uninformed) mind can only think of bad uses...
by bee_rider 5y ago
Wait, can any webdevs explain a legitimate use for these features? Because my (admittedly uninformed) mind can only think of bad uses...
- throwthere 5y agoRouting in single-page applications relies heavily on the history API I think.
- devinmcafee 5y agoThat's correct. When navigating around in a single page app, clicking on an in-app link won't trigger the browser to make a new HTTP GET to fetch an HTML response from the server. Instead, the routing system will use the pushState API to push a new entry into the history and update the DOM to match the new route. By using pushState, your client side JavaScript can replicate native browser behavior and preserve function of the back button to get to previous routes in the application.