Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.addEventListener('popstate', function(event) {
- // Do here what you want to do when click (back) on browser!
- // for example here is code to catch the current hash:
- var hashLocation = location.hash;
- var hashSplit = hashLocation.split("#!/");
- var hashName = hashSplit[1];
- if(hashName != '')
- {
- alert('gotcha! the back hash name was: ('+hashName+')');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement