7

Using javascript (I'm using jQuery if that simplifies things), how can I clear the back button history?

I do not mean the entire browser history.

I mean the history in the tab back button.

sergserg
  • 20,490
  • 40
  • 124
  • 179

2 Answers2

6

You cannot remove the entire back button history. All you can do is replace the last entry with the next page, using window.location.replace('url');

Rory McCrossan
  • 319,460
  • 37
  • 290
  • 318
-3

https://gist.github.com/921920

jQuery('div').live('pagehide', function(event, ui){
  var page = jQuery(event.target);    
  if(page.attr('data-cache') == 'never'){
    page.remove();
  };
});
Rubyist
  • 6,405
  • 9
  • 47
  • 84