问题
I am trying to get a basic sammy.js app running through phonegap.
The app loads fine but when running the app through my android (2.2) handset the routing doesn't seem to work- nothing happens when the links are clicked, but when running the app through an Android virtual device (2.1) the links work as expected and the correct templates are rendered.
Has anyone encountered this problem or similar who might be able to point me in the right direction as there is limited documentation regarding sammy.js and Phonegap?
回答1:
This is because of an issue with Android's browser. You can check the solution proposed here: https://github.com/quirkey/sammy/issues/105
Basically add this.disable_push_state = true;
in your $.sammy(function () {...}
and everything works fine.
来源:https://stackoverflow.com/questions/11034811/sammy-js-app-link-routing-not-working-in-phonegap