Pages

Wednesday, February 20, 2013

Disabling hashListening in jQuery Mobile 1.2

Just a quick note. Spending a little time today integrating Backbone.js with jQuery Mobile. Both frameworks have routing solutions which do not work together. However, there is some simple configuration that you can use to turn off the jQuery Mobile routing in favor of Backbone.js routing:
$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
    $.mobile.linkBindingEnabled = false;
    $.mobile.hashListeningEnabled = false;
    $.mobile.pushStateEnabled = false;
});
The trick to getting this to work is loading this bit of code before you load jQuery Mobile. More information at http://jquerymobile.com/demos/1.2.0/docs/api/globalconfig.html.

4 comments:

  1. wow..amazing post blog that understand the value of providing a quality resource for free
    visit our website
    Vashikaran Astrologer in Jayanagar

    ReplyDelete
  2. Nice Post! I liked it.

    abhiram astrology center. Best indian Astrologer In banff

    ReplyDelete