Why the new web Dropbox can change the URL without page refresh? [duplicate]

Possible Duplicate:
How to change the URL displayed in the browser without leaving the page
How to do awesome refreshless page changes like GitHub
Change browser URL and page content without reload and without using fragments

It is amazing! The new Dropbox web version can do this! It will do ajax request and change the url,but the page will not refresh!(not change the hash)

The url will change from https://www.dropbox.com/home/ to https://www.dropbox.com/home/Public.

You can try it.

How to achieve it?



They're using HTML5 Pushstate:


What is pushState?

The history object gains two new methods, pushState & replaceState, that allow us to change the current location of the browser without making an HTTP request. These new locations are stored in the browsers history so that both the back and forward button work as expected.

 history.pushState({foo: "bar"}, "foo page", "/foo")

This is something you can do within the same domain by using the history.pushState() method


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.