Re:Browsers are pretty good at loading pages
by efrafa on Sunday July 21, 2019 @04:31PM
(#20493483)
Its also really not that hard to make cmd click + back button to work properly with client side nav.
[ Parent
| on HN ]
Re:Browsers are pretty good at loading pages
by saagarjha on Sunday July 21, 2019 @04:37PM
(#20493505)
Can you support iOS's "peek" menu as well?
Re:Browsers are pretty good at loading pages
by regecks on Sunday July 21, 2019 @06:00PM
(#20493931)
Yes, I tried it just now on a random website I built in Vue. Any sane implementation of client-side navigation uses the History API[1]. It is indistinguishable from "real" navigation in the browser UI, apart from how fast it is.
If on the other hand, if you encounter code like the abomination below (which breaks cmd+click, peek and forward/back), you should not (imo) conflate it with actual client-side navigation. I suspect that's what some comments here are referring to.
<a href="#" onclick="loadContentIntoPane('contact')">Contact Us</a>
1. https://developer.mozilla.org/en-US/docs/Web/API/History_APIIs there anything special needed to support that? I’m pretty sure you just need an <a> tag with an href. With any SPA framework/library I’m aware of, you have to go out of your way to make it not work.