Complete examples of the SeaJS tutorial series (3)

  • 2020-03-30 02:10:47
  • OfStack

A complete example
The above mentioned so many, the knowledge points are relatively scattered, so I finally plan to use a complete SeaJS example to link up these knowledge points, convenient for friends to summarize and review. This example contains the following files:

1. Index.html -- main page.
2. Sea. Js - SeaJS script.
3. Init. Js -- init module, entry module, dependent on data, jquery, style three modules. Loaded by the main page.
4. Data.js -- data module, pure json data module, loaded by init.
5. Jquery. Js -- jquery module, the modular encapsulation of jquery library, is loaded by init.
6. Style.css -- CSS style sheets, loaded as style modules by init.
7. Sea. Js and jquery. Js code belongs to the library code, do not repeat, here only give their own written file code.

<html lang="zh-CN">
    <meta charset="UTF-8">
<div id="content">
    <p class="author"></p>
    <p class="blog"><a href="#">Blog</a></p>

<script src="./sea.js" data-main="./init"></script>


define(function(require, exports, module) {
    var $ = require('./jquery');
    var data = require('./data');
    var css = require('./style.css');


    author: 'ZhangYang',
    blog: ''



The operation effect is as follows:

< img border = 0 id = theimg onclick = window. The open this. (SRC) SRC = "/ / 20142394159 ">

Related articles: