Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does GitHub change the URL but not the reload? [duplicate]

Hey, I have noticed that when browsing a GitHub repository it uses AJAX to load each folder / file.

I understand all this, I was just wondering how they altered the URL. Can you get and set the URL with JavaScript? If so it could be very useful for bookmarking a section of a JavaScript based website. ( a few pages within one, moved between with JavaScript )

Thanks.

like image 333
Olical Avatar asked Feb 11 '11 20:02

Olical


2 Answers

It uses the new push/pop state functions in the history manipulation API.

like image 136
Matt Avatar answered Nov 04 '22 05:11

Matt


They described this html5 functionality on their blog here

like image 12
igorti Avatar answered Nov 04 '22 07:11

igorti