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

Use navigator history to handle click on return button #74

Open
eliemichel opened this issue Sep 27, 2015 · 4 comments
Open

Use navigator history to handle click on return button #74

eliemichel opened this issue Sep 27, 2015 · 4 comments

Comments

@eliemichel
Copy link
Member

Now for instance if you go to starred stations, then click on one of the stations to see its details, the return button redirects to the home instead of redirecting to the starred stations.

@Phyks
Copy link
Member

Phyks commented Oct 4, 2015

What about using history.replaceState() instead of hash navigation, and handling the return button from our code, without relying on the navigator history?

@eliemichel
Copy link
Member Author

Mmh I like the hash navigation, and it is a common practice. You cannot copy paste the URL to somebedy else if you use history.replaceState(). Plus, it seems dirty…

@Phyks
Copy link
Member

Phyks commented Oct 4, 2015

AFAIK, history.replaceState() changes the URL, but do not trigger the events the browser would normally handle when changing hash. Hence, benefits from changing hash, but single page application behaviour.

@eliemichel
Copy link
Member Author

Ah ok, I guess this is what GitHub or YouTube use. I had always wondered how they could include their own page loading display.

So, go for it, if it is a standard way.

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

No branches or pull requests

2 participants