Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting empty anchor map causes page to reload #11

Open
dshelepov opened this issue Sep 29, 2015 · 0 comments
Open

Setting empty anchor map causes page to reload #11

dshelepov opened this issue Sep 29, 2015 · 0 comments

Comments

@dshelepov
Copy link

Lines 363-365 in jquery.uriAnchor.js:

uri_string = anchor_string
        ? uri_array[0] + '#!' + anchor_string : uri_array[0]
        ;

cause the page to be reloaded when the anchorMap passed in has all parameters removed, because line 378,

document.location.href = uri_string;

will then set document href to uri_array[0], which will not have a '#!'.

One fix would be to replace lines 363-365 with something like

uri_string = uri_array[0] + '#!' + (anchor_string ?  anchor_string : "");

which will leave the hashbang in the HREF even when anchor_string is falsy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant