3
我已經開發了一個使用骨幹網的手機應用程序,需要js。 jquery mobile js從主js加載。無法在phonegap +骨幹應用中渲染jquery移動樣式
據我所知,要求js會爲我加載所有的js。所以我沒有必須手動加載它們使用<script>
在我的index.html
我不期待什麼?是否有一個特定的方法來加載手機+骨幹網中的jqm 我已經在這裏加載了jqueryMobile庫。
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.html head
。由於我最初加載了我的移動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>
問題是什麼? – 2013-02-26 13:00:22