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

History.js (html5 bundled) performs page reload if location.hash contains slashes #239

Open alvassin opened 11 years ago

alvassin commented 11 years ago

I'm using HTML5 jQuery bundled balupton History.js plugin. It's working fine, but i need to have ability to use links like (works fine without History.js)

http://website/url#popup=/url/some/more/params/ For a moment, if i will try to use it my hash page will be reloaded without hash - i've just tested this in environment with just History.js plugin (to ensure that is a History.js problem).

http://website/popup=/url/some/more/params/ But if i will try hash without "/" symbol, everything will be ok, location.hash will stay unchanged, no page reload will be made:

http://website/#popup=url Problem is that i would like to use native urls in #popup parameter. It's easy to handle and displayed this way link will be clear to users, everyone will be able to share link after popup is opened.

Is it possible to disable such location.hash change and redirects? I really don't think that using links with special delimeres is good idea:

http://website/#popup=url:param:values P.S. I've tried to apply encodeURIComponent() to popup url before adding it to location.hash, following url also removes hash and makes redirect:

http://website/#popup%3D%2Ftest%2Furl

ghost commented 11 years ago

It's resolved in official DEV branch now. Thank you for any testing!

ghost commented 11 years ago

Okay I'm not sure if this is resolved in HTML5 mode.

InkyLab commented 10 years ago

It is not resolved in HTML5 mode, I confirm. Would very cool if we could add/some/params to our URIs. It would make History.js a whole lot more interesting! And by the way, this issue should be referenced in the doc somewhere, it's kind of important...

vdellangela commented 7 years ago

Any news regarding this issue?

Anyone found a fix?