history.js
history.js copied to clipboard
Not able to use # in url links.
When i try to push following state, arguments are not getting pushed in history. History.pushState({ state: reqId, args: arguments }, null, "#" + reqId);
However, if i use "?" in place of "#" it is working properly..
I think that's a desired behavior, I think a exception is thrown also when you use a # in url. History.js supports HTML4+5 browsers and for HTML4 browsers hashtags are used to map url.
Currently our system uses # in urls and for some reasons we want to keep it that way.. Could you please tell if there is any workaround..
You can activate html4Mode (only in unofficial 1.8a2 version of this fork: https://github.com/andreasbernhard/history.js#options). Then you keep hashes with # in url. But please don't put # chars in url, because History.js adds them automatically. A url like: test.com/#test#test isn't valid!
Thanks for responding so quickly! Let me try that..
I downloaded the above mentioned fork and activated html4mode. I pushed the following state from one of the buttons. History.pushState({state:1,rand:Math.random()}, "State 1", "state=1");
URL changed to http://localhost:1528/history18/demo/index.html#./state=1?&_suid=1359611275677017746907970120118
i don't need extra "./" it should like
http://localhost:1528/history18/demo/index.html#state=1?&_suid=1359611275677017746907970120118
So it worked but there is a basepath issue, so ./ is appended. I entered it as a issue.
Trying to accomplish this using your fork but it doesn't seem to work. which package should I be using