18 May
2012
When creating a mobile application, Backbone.js and jQuery Mobile are two good solutions to use for your development. Both are providing a routing system but you'll get conflict using them together.
For that, the solution is to disable one, I prefer to take out jQuery Mobile router and keep using Backbone's one. In order to have the transition between the page, I am triggering manually the function $.changePage provided by jQuery Mobile, usually this one is used automatically by the JQM router.
To disable jQuery Mobile router add in your code before any jQuery mobile code:
$.mobile.ajaxEnabled = false;
$.mobile.linkBindingEnabled = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
$.mobile.changePage.defaults.changeHash = false;
Or have a look on the full example: