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