简体   繁体   中英

Detecting use of back/forward button inside Sammy.js application

In my current project we are using the Sammy.js framework for navigation. For a requirement I need to know whether a given route was run as a response of pressing the Back / Forward button or not.

Is there a way to identify that?

You can't know that precisely. All you can find out is wether the navigation event was received from inside the application (click on a link handled by Sammy, form submited , action in your JS ...) or if the navigation event came from the "outside" Back Button, Forward button, change in the URL bar, ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM