Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how does Facebook change the url without reloading the page? [duplicate]

Possible Duplicate:
How could I change window's location without reloading and # hack?
Facebook and Ajax

How does Facebook change the url without reloading the page?

Earlier facebook used the hash (#) to prevent the page from reloading each time new data had to load, but now a days Facebook change the whole url?! How the beeep is that possible?

like image 972
clarkk Avatar asked Oct 20 '11 20:10

clarkk


People also ask

How do I change URL without changing pages?

There is no way to modify the URL in the browser without reloading the page. The URL represents what the last loaded page was. If you change it ( document. location ) then it will reload the page.

Can JavaScript change URL?

In fact, JavaScript provides the location object, a part of the window object, which allows you to perform different URL-related operations.


1 Answers

They're using the History API. You can find some more demos at MDN too.

like image 93
Radu Avatar answered Oct 18 '22 01:10

Radu