Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. window.addEventListener('popstate', function(event) {
  2. // Do here what you want to do when click (back) on browser!
  3.  
  4. // for example here is code to catch the current hash:
  5. var hashLocation = location.hash;
  6. var hashSplit = hashLocation.split("#!/");
  7. var hashName = hashSplit[1];
  8. if(hashName != '')
  9. {
  10. alert('gotcha! the back hash name was: ('+hashName+')');
  11. }
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement