Casync.js Ria Rapid Build and development

Source: Internet
Author: User
Tags file url

Official casync.js:www.cityooh.com
C_async.js is a free, JQ-based development framework that helps you to modularize subsets of features, quickly build single-page Web applications, assemble common features in daily RIA Development, and customize the import based on actual project requirements.
At present, Casync.js introduces the concept of page and define, which is a modular loader similar to sea.js, which can greatly facilitate developers to divide the project structure.
The following is a simple example:
First, you need to introduce some of the following files

Config.js (function ($) {var $g = window. $g = {modules: $c. Page ("Body"), {home: "Js/home.js", Pageone: "Js/pageone. JS ", Pagetwo:" Js/pagetwo.js ", Pagetre:" Js/pagetre.js "}), Plugin: $c. Page ({pluginone:" Js/plugin/pluginone.js ", Plugintwo: "Js/plugin/plugintwo.js", Pluginthr: "Js/plugin/pluginthr.js"}), Global: $c. Page ({configone: "js/config/ Configone.js "})}; $g. Modules.home.display (function () {Console.log (" Home ");}); $g. Global.configOne.get (function () {Console.log ($g. global.configone);}); ) (JQuery);

Home.js$c.define ({//Here is page  it for the Declaration page module page: $g. Modules.home,//url inject the current JS specific implementation of the dependency file URL: ["Js/homeone.js", "Js/ho Metwo.js "," Css/home.min.css "," page/home.html "],constructor:function () {var self = This;self.say ();//return  is thrown out The method set    is similar to the role of exports in node. js in return {tell:function () {Self.say ();}};}} );


Homeone.js$c.define ({//here for parent  it points to its own parent pageparent: $g. Modules.home,url: ["Js/homethr.js"],constructor: function () {var = this;return {say:function () {console.log (self);}};} );




A hierarchical relationship is introduced in the code above homeone.js is a member of the Home.js.
Home.js can call Homeone inside and out. Of course you can also use $g in other modules. Modules.home.say (); To be used
If you want the method in the child to be used only internally you can also return in the parent = {Say:null}
So that it can disable the external module to use it
No constraints on development methods in Casync.js you can divide the management of the module arbitrarily
In the example above, I divided the project into the page layer (modules), the plug-in (plugin), the configuration layer (global)
You can also set the developer's personal preferences to MVC, and so on
For more information, refer to the official: www.cityooh.com

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.