javascript - Remember scroll position on navigating back to first page from second one -


if having page loading content ajax on scrolling bottom,if click on link on scrolling down position on page , navigate next page.and when next page,i press button ,i want page go same position cliked. please guide me how can done.

on navigating second page can send position via querystring , querystring on page using javascript , vice versa similarly.lets navigated on page2 'page2.html?position=44' here code querystring:

javascript:

function getquerystring(name) {     name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");     var regex = new regexp("[\\?&]" + name + "=([^&#]*)"),         results = regex.exec(location.search);     return results == null ? "" : decodeuricomponent(results[1].replace(/\+/g, " ")); } 

usage: var position = getquerystring('position');

hope helps.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -