HistoryManager icon indicating copy to clipboard operation
HistoryManager copied to clipboard

hashChanged to no hash

Open challet opened this issue 13 years ago • 1 comments

Hi Arieh,

This is a great plugin you published here. I'm using the HashListener part for some basic ajax loading and all works well except one little thing :

  • When the initial load occurs there is no hash in the URL, for instance http://myweb.site/some/page
  • The user clicks a hash link http://myweb.site/some/page#withdata , and HashListener do its magic thing to handle it and load content from Ajax.
  • But, if the user go back (through its browser button) to http://myweb.site/some/page the hash diseapears without the "hashChanged" being fired.

I wonder if it is browser limitation, or if there is a way to handle it ?

challet avatar Apr 25 '11 16:04 challet

This will actually fire the "removed" event. In my case I can call the function below.

 this.HM.addEvent('page:removed', function (){
   this.HM.set('page', 'get_started');
 }.bind(this))

styks1987 avatar Dec 21 '11 17:12 styks1987