A complete example
Having said so much above, the knowledge points are relatively scattered, so in the end I plan to use a complete SeaJS example to string together these knowledge points, so that friends can summarize and review them. . This example contains the following files:
1.index.html - main page.
2.sea.js——SeaJS script.
3.init.js——init module, entry module, relies on three modules: data, jquery, and style. Loaded from the main page.
4.data.js——data module, pure json data module, loaded by init.
5.jquery.js - jquery module, a modular encapsulation of the jQuery library, loaded by init.
6.style.css - CSS style sheet, loaded by init as a style module.
7. The code of sea.js and jquery.js belongs to the library code, so I won’t go into details. Here I only give the code of the file I wrote.
html: