Thursday 15 September 2011

javascript - Using History.js back button doesn't work? -


I'm using history.js from here

It's currently in my:

  var history = window. History; If (history.enabled) // // is the initial position for the first page that var state = history .getState (); History.pushState ({urlPath: window.location.pathname}, $ ("title"). Text (), State. Arlpath); } Other {return false; } // Content Update and Back / Forward Button Handler History.Adapter.bind (window, 'static', function) (var s = History.getState (); History.log (s.data, s.title, s Url) ; // update type load type onLoadPageByURL (s.data.urlPath);}); // Navigation Link handler $ ('body'). ('Click', 'a', function (e) {e.prevent default (); var load = $ (e.currentTarget) .data ('load'); var urlpath = $ (this) .attr (' Href '); var title = $ (this) .text (); History.pushState ({load: load, urlPath: urlPath}, title, urlPath);});  

It seems that everything should work, but the back button is not working properly? What am I doing wrong?


No comments:

Post a Comment