Build a JavaScript-based mobile web Cms--hello,world

Source: Internet
Author: User

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 Resources

QQ Discussion Group: 344271543

Source Code Github:https://github.com/gmszone/moqi.mobi

Build a JavaScript-based mobile web Cms--hello,world

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.