像导航一样的github [重复]

This question already has answers here:
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2012-02-09 07:16:29Z" class="relativetime">8 years ago</span>.</div>
        </div>
    </aside>

Possible Duplicate:
How does github change URL without reloading a page?


I don't know how to describe but how does this cool slide effect on github file explorer work?
Not the graphical part but the javascript/ajax logic behind. It seems like the page isn't reloading and the next directory just slides in. I thought that with javascript you only can change the hash, not the whole path of the url.
So, how is it possible to change the url from somedomain.com/foo to somedomain.com/foo/bar without reloading the whole page, just loading the new content via ajax or websockets. I definitly don't know how to do this, or with which trick this works on github.

</div>

You can use javascript libraries for this kind of thing. A good one is History.js. It uses push state when it can and falls back to hash bang urls when not. I've used it in a couple of projects and find it really good especially if you use js templates as well. Such as Dust.js

Here is a link to the Historyjs github page history js.

As far as the ajax goes. I used a type identifier on my url. So when a user navigates to /home, there is no page reload and instead an ajax call is dispatched to /homepage.json From which a json response is retrieved and then rendered into the dom or the js template.