How to make it so that when you press the button back, the scrolling is on another page with the anchor # links123. Where the transition actually began

$(document).ready(function(){ $('body').on('click','#nav-load a',function(){ var urlNext = $(this).attr('href'); var scrollNext = $(this).offset().top - 200; if (urlNext !== undefined) { $.ajax({ url: urlNext, beforeSend: function() { ShowLoading(''); }, success: function(data) { $('#bottom-nav').remove(); $('#dle-content').append($('#dle-content', data).html()); $('#dle-content').after($('#bottom-nav')); window.history.pushState("", "", urlNext); $('html, body').animate({scrollTop:scrollNext}, 800); HideLoading(''); }, error: function() { HideLoading(''); alert('что-то пошло не так'); } }); }; return false; }); }); 

The problem seems to be in this line

 window.history.pushState("", "", urlNext); 
  • In the title you have about the anchor, and the question about the button "back" ... - Enikeyschik
  • that's right Anchor goes to the page ads. and you need to return to it when you press the button back - Never3D
  • Clear. Only in the question is written a little more. Edit the question to make it clearer. - Enikeyschik
  • Fixed a question, help be kind - Never3D
  • I think the problem is in window.history.pushState ("", "", urlNext); - Never3D 6:26 pm

0