バックボーンを使用してphonegapでアプリを開発しましたが、jsが必要です。jquerymobilejsはメインjsからロードされます。
私の知る限り、requirejsはすべてのjsをロードします。<script>
だから私は自分の中で使用してそれらを手動でロードする必要はありませんindex.html
私は何を探していませんか?ここでjqueryMobileライブラリをロードしたphonegap+バックボーンにjqmをロードする特定の方法はありますか?
require.config( {
paths: {
"jquery": "libs/jquery",
"jquerymobile": "libs/jquerymobile",
"underscore": "libs/lodash",
"backbone": "libs/backbone"
},
shim: {
"backbone": {
"deps": [ "underscore", "jquery" ],
"exports": "Backbone" //attaches "Backbone" to the window object
}
}} );
require([ "jquery", "backbone", "routers/mobileRouter" ], function( $, Backbone, Mobile ) {
$( document ).on( "mobileinit",
function() {
$.mobile.linkBindingEnabled = false;
$.mobile.hashListeningEnabled = false;
}
)
require( [ "jquerymobile" ], function() {
this.router = new Mobile();
}); } );
これは私のindex.htmlhead
です。最初にモバイルjsを読み込んでいるので、ヘッダーのスタイルにjqmスクリプトは必要ありません。
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>RideSmart App</title>
<script src="js/libs/require.js" data-main="js/mobile"></script>
<link rel="stylesheet" href="css/jqm1.3.0.min.css" />
<script type="text/javascript" charset="utf-8" src="jsLib/phonegap.js"></script>
</head>