Guest User

Untitled

a guest
Dec 12th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. jQuery(document).ready(function($) {
  2.  
  3. if (window.history && window.history.pushState) {
  4.  
  5. $(window).on('popstate', function() {
  6. var hashLocation = location.hash;
  7. var hashSplit = hashLocation.split("#!/");
  8. var hashName = hashSplit[1];
  9.  
  10. if (hashName !== '') {
  11. var hash = window.location.hash;
  12. if (hash === '') {
  13. alert('Back button was pressed.');
  14. window.location='www.example.com';
  15. return false;
  16. }
  17. }
  18. });
  19.  
  20. window.history.pushState('forward', null, './#forward');
  21. }
  22.  
  23. });
  24.  
  25. $(window).bind('onpopstate', function(e){
  26. //your dark doings here
  27. });
  28.  
  29. bajb_backdetect.OnBack = function(){
  30. document.location.href = 'http://google.com';
  31. }
Add Comment
Please, Sign In to add comment