Jquery mobile Windows Phone 8 requirejs未加载模块

Jquery mobile Windows Phone 8 requirejs未加载模块,jquery-mobile,windows-phone-8,cordova,requirejs,Jquery Mobile,Windows Phone 8,Cordova,Requirejs,尝试使用PhoneGap、Jquery Mobile和Requirejs将iOS/Android Html5应用程序移植到WP8 应用程序失败,提示模块未加载 错误:[“无法获取未定义或空引用文件的属性‘调试’:x-wmapp0:www/scripts/main.js行:60”,“DebugConsole404227917”] 此消息表示Config.js中的Config对象为null 我认为这个问题是由模块的错误相对路径造成的,由于某些原因,在WP8中不同,但是我找不到正确的组合 有没有人对W

尝试使用PhoneGap、Jquery Mobile和Requirejs将iOS/Android Html5应用程序移植到WP8

应用程序失败,提示模块未加载

错误:[“无法获取未定义或空引用文件的属性‘调试’:x-wmapp0:www/scripts/main.js行:60”,“DebugConsole404227917”]

此消息表示Config.js中的Config对象为null

我认为这个问题是由模块的错误相对路径造成的,由于某些原因,在WP8中不同,但是我找不到正确的组合

有没有人对WP8上的requirejs有任何经验?我做了大量的搜索,但我发现(不是很多)似乎没有任何帮助

由require.js加载的main.js文件,该文件本身会被执行,调试消息会从中发出,但不会从require.function(..)块发出

我使用的是requirejs(2.1.8)、jquery mobile(1.3.1)和phonegap(2.9.0)


我发现,如果我使用“shim”配置,模块将被加载,这似乎可以归结为shim配置中的行[urlArgs:'rev=v3'],以及项目中的一些小的结构更改。一个简单的requirejs+cordova+WP8似乎无论如何都可以正常工作。如果您真的需要向html页面传递一个参数:
require.config({
    // modules
    paths: {
        'domReady'                : 'vendor/domReady',
        'jquery'                  : 'vendor/jquery.min',
        'jquery.mobile'           : 'vendor/jquery.mobile-1.3.1.min',
        'handlebars'              : 'vendor/handlebars',
        'AppHistory'              : 'modules/AppHistory',
        'CatalogController'       : 'modules/CatalogController',
        'CleaningController'      : 'modules/CleaningController',
        'Config'                  : 'modules/Config',
        'Consultants'             : 'modules/Consultants',
        'CoverageController'      : 'modules/CoverageController',
        'ExternalDataHandler'     : 'modules/ExternalDataHandler',
        'Languages'               : 'data/LanguageData',
        'LanguageController'      : 'modules/LanguageController',
        'LocalStorage'            : 'modules/LocalStorage',
        'ProductDetailController' : 'modules/ProductDetailController',
        'Scanner'                 : 'modules/BarcodeScanner',
        'SeminarController'       : 'modules/SeminarController',
        'SeminarDetailController' : 'modules/SeminarDetailController',
        'TechnicalRequest'        : 'modules/TechnicalRequest',
        'TemplateEngine'          : 'modules/TemplateEngine'
    },
    // dependencies
    shim: {
        'jquery' : {
            exports: 'jQuery'
        },
        'jquery.mobile' : ['jquery'],
        'handlebars' : {
            exports: 'Handlebars'
        }
    },
    urlArgs: 'rev=v3'    // production setting
    // urlArgs: 'rev=' + (new Date()).getTime()    // development setting
});

require(['domReady', 'jquery', 'app', 'Config', 'jquery.mobile'],
    function(domReady, $, App, Config) {

        'use strict';

        if (Config.debugging || window.location.search.match(/debug/)) {
            // for production enable debug mode by get param "?debug=true"
            debug = true;
        }

        // domReady is RequireJS plugin that triggers when DOM is ready
        domReady(function () {

            function onDeviceReady(desktop) {

                // Hiding splash screen when app is loaded
                if (desktop !== true) {
                    cordova.exec(null, null, 'SplashScreen', 'hide', []);
                }

                Config.platform = (window.device && window.device.platform) ? window.device.platform : 'WebApp';
                Config.eventType = 'click';    // kein touchevent mehr verwenden

                // globale Konfiguration für jQuery und jQuery Mobile
                $.support.cors = true;
                $.mobile.ajaxEnabled = false;
                $.mobile.allowCrossDomainPages = true;
                $.mobile.defaultPageTransition = 'fade';
                $.mobile.hashListeningEnabled = false;
                // $.mobile.linkBindingEnabled = false;
                $.mobile.pushStateEnabled = false;
                $.mobile.touchOverflowEnabled = true;

                App.initialise(desktop);

            }

            /*
            Wir checken nicht nur, ob es sich um ein mobiles Gerät handelt, sondern
            ob auch Phonegap aka Cordova initialisiert ist, sprich mit der nativen
            API und somit dem mobilen Endgerät spricht.
            */
            if (window.device && window.device.platform && window.device.platform.match(/Android|iOS|Win32NT/)) {
                // This is running on a device so waiting for deviceready event
                document.addEventListener('deviceready', onDeviceReady, false);
            } else {
                // On desktop don't have to wait for anything
                onDeviceReady(true);
            }

        });

    }
);