[Original works] Requirejs Introductory Step-by-step tutorial

Source: Internet
Author: User

Recently I found that RSS data is a fun thing to do, that is, you can directly put other people's data on their own website. If netizens find this article elsewhere, come to the blog park to see it (http://zhutty.cnblogs.com). This makes the code neat. In addition, welcome to the group of communication, 164858883.

Well, this essay focuses on a framework for web-optimized functionality. Requirejs.

The official introduction is this: Requirejs is a JavaScript file and module loader. Yes, just a word is enough. Its function is to load the module.

This involves the problem of web optimization, if all the JS written on the page, or multiple files, directly introduced, will make the page very lag. It's impossible to look directly at a low-profile computer or mobile phone. Therefore, it engineers think of the said JS in a file, single from the point of view of software engineering, this can not be maintained. Serious breaches of the basic requirements of low coupling. Well, that's it, require.

Require can be used not only in the browser, but also in other JavaScript, such as Nodejs. By the way, Nodejs also follow the COOMONJS specification, the bottom layer for C + + implementation, so the execution efficiency is high. Of course, it is running on the server side.

OK, now let's talk about the basic structure of this demo web directory.

Www

|-app

|-controller

|-model

|-main.js

|-lib

|-require.js

|-jquery.js

|-index.html

|-config.js

|-main.js

OK, let's start with a little bit about how it works. Introduce Requirejs in the page. (Have lunch first.) Cond..... Welcome attention, Continuous Update)

[Original works] Requirejs Introductory Step-by-step tutorial

Related Article

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.