摘要: RequireJS是一个模块加载框架,所以为了最直观的感受它,我们先来看看它的加载系统。先看入口方法:/** * Does the request to load a module for the browser case. * Make this a separate function to allow other environments * to override it. * * @param {Object} context the require context to find state. * @param {String} moduleName the name of the m 阅读全文
posted @ 2011-12-30 13:23 越己 阅读(4868) 评论(2) 推荐(2) 编辑
摘要: 例子来自官方,我稍微改造了一下,如下:// project.html<!DOCTYPE html><html> <head> <title>requirejs</title> <!-- data-main attribute tells require.js to load scripts/main.js after require.js loads. --> <script data-main="scripts/main" src="scripts/require.js"&g 阅读全文
posted @ 2011-12-30 11:07 越己 阅读(9299) 评论(1) 推荐(2) 编辑