person.js /** * This example make use of requireJS to provide a clean and simple way to split JavaScript class definitions * into separate files and avoid global namespace pollution. http://requirejs.org/ * * We start by defining the definition withi…
/** * Created with JetBrains PhpStorm. * User: scotty * Date: 28/08/2013 * Time: 19:39 */ ;(function(global){ "use strict"; var M = function() { // Constructor. arguments are passed // from Module() call. this refers to m. function init() { meth…
可以找到许多的解读,但是原文总是最重要的,也是最正宗的说明,直接访问 RequireJS 有时不太方便,这里将 RequireJS 2.0 API 的原文转载到博客园,方便查看. This is the RequireJS 2.0 API. If you want 1.0: Link to 1.0. Usage §§ 1-1.3 Load JavaScript Files§ 1.1 data-main Entry Point§ 1.2 Define a Module§ 1.3 Simple Na…