标签:style class c blog java ext
<script type="text/javascript" src="/dep/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="/dep/underscore-1.6.0.min.js"></script> <script type="text/javascript" src="/dep/backbone-1.1.2.js"></script> <script type="text/javascript" src="/dep/require-2.1.11.min.js"></script>
require.config({ baseUrl: ‘/src/‘, paths:{ underscore: ‘/dep/underscore-1.6.0.min‘, jquery: ‘/dep/jquery-1.11.1.min‘, backbone: ‘/dep/backbone-1.1.2.min‘ }, shim: { ‘backbone‘: { deps: [ ‘underscore‘, ‘jquery‘ ] } } });
require([‘enter‘], function(main){ main.enter(); });
define([‘backbone‘], function (backbone) { // 异步加载某模块,可在此处做一些路由处理 var enter = function(model){ model = model||‘helloWorld‘; window.require([model], function(helloWorld){ var $container = $(‘#main‘); helloWorld.init($container); }); }; return { enter: enter }; });
backbone与require的共存问题解决,布布扣,bubuko.com
标签:style class c blog java ext
原文地址:http://www.cnblogs.com/longze/p/3747795.html