javascript - Detect back button in browser when the user go back to original page -
i have page hides query string parameter on load using pushstate method in javascript. example original url,
www.iprocess.com?acsn=23423432423432434;
what hides acsn parameter on load. looks
www.iprocess.com
problem when click link inside page , goes page read www.iprocess.com without query string parameter data not load.
what want if user go page loads query string parameters @ same time hides it.
this code:
window.history.pushstate('currentpage', 'title', window.location.pathname);
instead of using pushstate
, use replacestate
, way won't keep parameter state in history.
note easy make live example, here plnkr.
please open windowed mode ( in top right corner)
Comments
Post a Comment