Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks!


OK, in retrospect that was confusing.

Both hashtags and pushState are ways of changing the page and the URL using Javascript. pushState is the "legal" way, which changes the page's URL (i.e. twitter/posts/1 -> twitter/posts/2). hashtags technically don't change the page, they change the part of the URL after the hash (i.e. twitter/posts#1 -> twitter/posts#2).

hashtags are used because older browsers don't let you use pushState. pushState is used because it's more correct, and doesn't exploit a hacky loophole.

Both are used because they are faster than a whole new page request, and they let you share the post by cutting and pasting the URL in your address bar.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: