Jquery mobile 为什么不按requirejs加载脚本
然后根据我的文件夹结构克隆jquery.mobile.router.js。这是我的requirejs配置Jquery mobile 为什么不按requirejs加载脚本,jquery-mobile,requirejs,Jquery Mobile,Requirejs,然后根据我的文件夹结构克隆jquery.mobile.router.js。这是我的requirejs配置 //bootstrap.js content require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module shim: { underscore
//bootstrap.js content
require.config({
// The shim config allows us to configure dependencies for
// scripts that do not call define() to register a module
shim: {
underscore: {
exports: '_'
},
jquery: {
exports: 'jquery'
},
backbone: {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
backboneLocalstorage: {
deps: ['backbone'],
exports: 'Store'
},
jQueryMobile : {
deps:['jquery'],
exports: "jQueryMobile"
}
},
paths: {
jquery: 'js/vendor/jquery',
jQueryMobile: 'js/vendor/jquery.mobile.min',
underscore: 'js/vendor/underscore.min',
backbone: 'js/vendor/backbone',
backboneLocalstorage: 'js/plugins/localStorage',
text: 'js/plugins/text',
'jquery.mobile.router': 'js/plugins/jquery.mobile.router'
}
});
所有脚本都可以加载,但jquery.mobile.router没有加载。
我的弗洛德结构如下
/app
/js
|-plugins
|-jquery.mobile.router.js
/bootstrap.js
谁能告诉我我做错了什么?提前谢谢。你有没有打电话给jquery.mobile.router,地址如下
require(['jquery.mobile.router'], function () {
});
可以发布错误消息吗?控制台中没有显示错误消息。我查看了路径。。路径是正确的,我下载了程序,可以加载所有东西。。因此,如果您使用Chrome,请转到“检查元素”,然后转到“网络”“选项卡,它应该显示是否加载了内容。或者,如果您使用firefox,从firebug/Net,您也可以看出…是的,在repo中,它正在工作,在我提到的第一行。
我克隆了这个repo,然后根据我的文件夹结构放置jquery.mobile.router.js
。无论我用shim config找到什么解决方案,你都可以按照这个程序进行。我也使用JQM路由器: