page.js
page.js copied to clipboard
Filename is lost on routing to root
The filename component of location is lost when you navigate to "/".
EX:
- hashbang routing
- page located at http://foo.com/bar.html
- click
<a href="/example"/>
- location is now http://foo.com/bar.html#!/example
- click
<a href="/" />
- location is now http://foo.com (missing bar.html)
This comes up when using history.back() as well.
Hi, i just made a pr and fixed the problem. the first problem was that you should've used
history.pushState(...);
instead of
history.replaceState(...);
and the second one was that you could use location.href
in clickHandler
function instead of pathname
, search
, and hash
properties.
make sure to inform me if anything was wrong with it.