browserstate / history.js

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.
http://browserstate.github.com/history.js/demo/
Other
10.74k stars 1.35k forks source link

#./ vs #/ in HTML4 , demo vs implementation #193

Open divisi0nby0 opened 12 years ago

divisi0nby0 commented 12 years ago

I've just downloaded History.js, planning on using it in a new application, but have noticed something odd about the demo which I'm hoping someone can clear up.

First of all, I modified the index.html demo so the states being pushed were all /state1, /state2 etc. i.e. nice clean paths

This all worked great when I tried it in FF, Chrome and IE7/8/9 from:

http://mysite.com/js/balupton-history.js-e84ad00/history.js/demo/

HTML5 URLs look like

http://mysite.com/js/balupton-history.js-e84ad00/history.js/demo/state1

and HTML4 ones like

http://mysite.com/js/balupton-history.js-e84ad00/history.js/demo/#/state1

But when I copied the demo to the root of my site, and changed the paths to the JS files to be:

/js/json2.js /js/jquery.js /js/jquery.history.js

I noticed that in HTML4 browsers (IE7/8/9) the URLs come out like

http://mysite.com/js/balupton-history.js-e84ad00/history.js/demo/#./state1

Does anyone know why the dot is being added after the hash? Apart from the location of the demo file, and the paths to the JS files everything is identical.

jaideep87 commented 12 years ago

Did you find a reason? having same problem

maddhacker24 commented 12 years ago

I am also having this issue. Did you find what was causing this to happen?

ken47 commented 12 years ago

You can modify Line 515 in history.js. It seems like a typo, but only time will tell.

AlexGalays commented 11 years ago

Still have that same issue. This project lacks tests hehe.

lnpbk commented 11 years ago

Does anyone have any insight into this? I have the same issue

AlexGalays commented 11 years ago

This project is imo, more stable and better all around: https://github.com/devote/HTML5-History-API

Bitneko commented 9 years ago

Modifying line 515 in history.js works for me.