Why can the new Dropbox web change URL without refreshing the page?

Possible duplicate:
How to change the URL displayed in the browser without leaving the page
How to make amazing updated page changes like github
Change browser URL and page content without reloading and without using fragments

It's amazing! Dropbox's new web version can do it! It will execute an ajax request and change the url, but the page will not refresh (does not change the hash)

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

You can try.

How to do it?

+2
javascript ajax
Mar 15 '12 at 10:23
source share
2 answers

They use HTML5 Pushstate:

http://badassjs.com/post/840846392/location-hash-is-dead-long-live-html5-pushstate

What is pushState?

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

history.pushState({foo: "bar"}, "foo page", "/foo") 
+2
Mar 15 '12 at 10:27
source share

This is what you can do in the same domain using the history.pushState() method

+1
Mar 15 '12 at 10:26
source share



All Articles