Complete example of the Seajs Introductory tutorial series (III)

Source: Internet
Author: User
Tags require jquery library

  This article mainly introduces the complete example of the Seajs Introductory tutorial series, demonstrates a complete SEAJS development example, and needs a friend to refer to the following

A complete example above said so much, the knowledge point is more dispersed, therefore finally I intend to use a complete seajs example to put these knowledge points together, facilitates the friend to generalize the review. This example includes the following file:   1.index.html--homepage. 2.sea.js--seajs script. 3.init.js--init module, Portal module, relies on data, jquery, style three modules. Loaded by the master page. 4.data.js--data module, pure JSON data module, loaded by init. 5.jquery.js--jquery module, modular encapsulation of the jquery library, loaded by init. The 6.STYLE.CSS--CSS style sheet, which is loaded as a style module by init. 7.sea.js and Jquery.js code belong to the library code, do not repeat, here only give the code of the file you write. HTML:     code is as follows: <! DOCTYPE html> <html lang= "ZH-CN" > <head>     <meta charset= "UTF-8" >     <TITL e></title> </head> <body> <div id= "Content" >     <p class= "Author" ></p >     <p class= "blog" ><a href= "#" >Blog</a></p> </div>   <script src= "./sea.js" data-main= "./init" ></script> </body> </html> javascript:   Code is as follows://init.js define (function (Require, exports, module) {    var $ = require ('./jquery ');     var data = require ('./data ') );     var css = rEquire ('./style.css ');       $ ('. Author '). html (Data.author);     $ ('. Blog '). attr (' href ', data.blog); });  //data.js define ({    author: ' Zhangyang ',     blog: ' http://blog.codinglabs.org '});   CSS:   code as follows:. author{color:red;font-size:10pt; blog{font-size:10pt;}    

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.