In an introduction to building a JavaScript-based mobile Web CMS-A brief introduction to some of the principles of the Qi CMS, which is composed of its polar framework. Then we should explain how the CMS is built.
Requirejs using libraries and dependencies
Here is the Bower JS to download the library. Specific can take a look at Bower install JS use Bower Management JS this article.
Libraries that need to be downloaded have
- Requirejs
- Backbone
- Underscore
- Mustache
- Jquery
Using Requirejs
Sample demo from the official website
<! DOCTYPE html>
We need a require.js and a main.js in the same folder, 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 done with a major framework that just doesn't have HTML, and this will continue the next time.
Related ResourcesQQ Discussion Group: 344271543
Source Code Github:https://github.com/gmszone/moqi.mobi
Build a JavaScript-based mobile web Cms--hello,world