Sea.js Official document: https://seajs.github.io/seajs/docs/#docs
Follow the CMD specification
Use the Tutorial:
1.index.html introduces Sea.js and initializes the configuration, and then calls Seajs.use (' main.js ') to invoke the main program to start
<script src= "Src/sea.js" type= "Text/javascript" charset= "Utf-8" id= "Seajsnode" ></script>
<script type= "Text/javascript" >
Seajs.config ({
Alias: {
' jquery ': ' jquery.min.js ' //Because Jqeury follows the AMD specification, all to modify the jquery file define (function () {. SOURCE return $.noconflict (); })
}
})
Seajs.use ("./src/index.js")
</script>
2. All JS files are defined with the Define function
Defile (function (require,exports,module) {
Load other modules with require
Loading additional modules asynchronously via Require.async
var $ = require (' jquery ');
exportsis an object that is used to provide a module interface to the outside.
Exports.a=1;
moduleis an object that stores some properties and methods associated with the current module.
module.exports={
A:A,
Fn:function () {} '
}
})
Sea.js Study Notes