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

In my current project, we use the Sammy.js framework for navigation. Upon request, I need to know whether this route was launched as a response to pressing the Back / Forward button or not.

Is there a way to identify this?

+7
javascript
source share
1 answer

You cannot know for sure. All you can find out is that the navigation event was received from the application (click the link processed by Sammy, the form is submitted, the action is in your JS ...), or if the navigation event came from the "external" Back button, Forward button, change URL string, ...

0
source share

All Articles