Abhishek Raj
Abhishek Raj

Reputation: 37

Why does Facebook navigation bar fixed and placed on top does not reload on moving to other pages?

I was curious about this since a long time ago. When we click on any link in the page, like security page or even a person's name or inbox, the url changes but the navigation bar remains as it is. It does not reload but the rest of the page does, I know things like this can be done using Jquery and by changing the elements of display but how does the url change too!

Upvotes: 0

Views: 221

Answers (1)

Rob M.
Rob M.

Reputation: 36511

It is a combination of AJAX and the history.pushState() method which allows you to update the URL and manipulate the browser's history:

https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#The_pushState()_method

Upvotes: 1

Related Questions