In general, there is a code. Follows a link with ajax without refreshing the page. But if you copy the url and paste it in a new window, then only the content of the content is displayed. How to make the whole page appear
$('.menu__link').click(function() { var url = $(this).attr('href'); $.ajax({ url: url + '?ajax=1', success: function(data){ $('#content').html(data); } }); if(url != window.location){ window.history.pushState(null, null, url); } return false; }); $(window).bind('popstate', function() { $.ajax({ url: location.pathname + '?ajax=1', success: function(data) { $('#content').html(data); } }); });
location.hash. Accordingly, when visiting a page, read the hash and download the content - ArchDemon