2

jquerymobile のルーティングを無効にしようとしていますが、ページの読み込みエラーが表示され、URL がバックボーンにキャッチされません。いくつかのチュートリアルで読んだように、jqeurymobile のすべてのパラメーターを無効にしました。

ここで jquerymobile を無効にします:

       require.config({
     paths: {
    jQuery: '../libs/jquery/jquery-loader',
    jQueryMobile: '../libs/jquery.mobile/jquery.mobile-loader',
    underscore: '../libs/underscore/underscore-loader',
    Backbone: '../libs/backbone/backbone-loader',
    order: '../libs/require/order-1.0.5',
    text: '../libs/require/text-1.0.6',
    async: '../libs/require/async',
    //PhoneGap: '../libs/phonegap/phonegap-loader',
    Handlebars: '../libs/handlebars/Handlebars',
    templates: '../templates'
        }
        });

         require(['order!jQuery'], function($) {

      // jQueryMobile configuration
       $(document).bind("mobileinit", function() {
    $.mobile.ajaxEnabled = false;
    $.mobile.autoInitializePage = false;
    $.mobile.linkBindingEnabled = false;
    $.mobile.hashListeningEnabled = false;
    $.mobile.pushStateEnabled = false;
    $.mobile.changePage.defaults.changeHash = false;
    $.mobile.pageContainer = $("body");

    // Remove page from DOM when it's being replaced, otherwise the DOM will contain    
    all of them
    $('div[data-role="page"]').on('pagehide', function(event, ui) {
        $(event.currentTarget).remove();
    });
     });

     // We launch the App
       // jQueryMobile is referenced in order to start its initialization
      require(['underscore', 'Backbone', 'router', 'jQueryMobile'], function(_,  
       Backbone, AppRouter, jQueryMobile) {



    document.addEventListener("deviceready", run, false);
     run();

    function run() {

        var sync = Backbone.sync;
      Backbone.sync = function(method, model, options) {
      options.beforeSend = function (xhr) {
      xhr.setRequestHeader('X-Parse-Application-Id', 'niI               
      BCf78Rfe1wu**yQWUrr6A3yyhex3M');
      xhr.setRequestHeader('X-Parse-REST-API-Key', 'l4CgjESBwPYA**3Pq1V1LKHTvuhQj');
          };



        sync(method, model, options);

      },

        app = new AppRouter();
        Backbone.history.start();

        Parse.$ = jQuery;


       Parse.initialize("niIBCf***7tbnyQWUrr6A3yyhex3M",
               "HD4bsMvPh3T*YvT1MIdOh2GR");

          }
        })
         });

ここでurlが宣言されています:

         <div data-role="navbar" data-theme="d" data-position="fixed">
                    <ul>
                        <li><a href="#" data-icon="grid"></a></li>
                        <li><a href="#/insert" data-icon="home"></a></li>
                        <li><a href="#" data-icon="search"></a></li>
                    </ul>
                </div><!-- /navbar -->   
4

1 に答える 1