A
A
Archakov Dennis2016-04-08 01:56:08
JavaScript
Archakov Dennis, 2016-04-08 01:56:08

How to make navigation like VK?

I want to implement AJAX site navigation and everything loads perfectly. With the help onpopstateI catch the transition back. And when I click on the back button in the browser, my function is executed nav.go(document.location.pathname);, but <head>everything is cleared (all styles, etc.).

I know that VK also has AJAX navigation, but how do they catch the transition back and perform only their function and why everything inside is cleared <head>.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Taratin, 2016-04-08
@Taraflex

https://github.com/devote/HTML5-History-API
At the very end of the page there are links to demos.

M
My joy, 2016-04-08
@t-alexashka

Look towards the pjax plugin.

A
Andrey Burov, 2016-04-08
@BuriK666

https://developer.mozilla.org/ru/docs/Web/API/Hist...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question