In an introduction to building a JavaScript-based mobile Web CMS--A brief introduction to some of the principles of the Qi CMS, its polar framework, and then began to explain how the CMS is built step after step.
Requirejs using libraries and dependencies
Here is Bower js to download the library, detailed can refer to Bower install JS use Bower Management JS this article.
Libraries that need to be downloaded have
- Requirejs
- Backbone
- Underscore
- Mustache
- Jquery
Using Requirejs
Example of quoting official website
<! DOCTYPE html>
We need a require.js and a main.js in the same directory, using require () in main.js to load the script that needs to be loaded.
Require.config ({ baseUrl: ' lib/', paths: { jquery: ' Jquery-2.1.1.min ' }, shim: { Underscore: { exports: ' _ '}}} ); require (['.. /app '], function (APP) { app.initialize ();});
The other libraries can be configured in config, and then the app.js is called.
define ([' jquery ', ' underscore '], function ($, _) { var initialize = function () { console.log ("Hello World"); } return { initialize:initialize };});
When the index.html is opened, it is output in the console Hello World
. So we're going to complete a basic framework, but there's no HTML, and this will continue the next time.
Related ResourcesQQ Discussion Group: 344271543
SOURCE Github:https://github.com/gmszone/moqi.mobi
Build a JavaScript-based mobile web Cms--hello,world