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