Open HTML5 Technology website, full screen "5 recommended JavaScript framework", "10 Mobile application Framework", all of your sister's framework,
But, do you know that these frames are dry hair? Come on, let's comb it out.
The framework currently covered by HTML5 can be broadly divided into the following categories:
1. Cross-platform development framework: PHONEGAP, Titanium, Trigger.io (business)
Such frameworks are interfaces that provide the web with the underlying hardware, allowing developers to develop native apps using web-like technology.
2. UI Framework: JQuery Mobile, Sencha Touch, Jqmobi
This type of framework provides "controls": Layouts, buttons ...
3. MVC framework: Backbone.js, Spine.js, ember.js
This type of framework provides the technology for model, view separation on the JavaScript side because, in the case of one page, JavaScript
The logic of control is becoming more and more complex and needs to be separated.
4. Dependency and load frame: require.js, sea.js
When we want to write a slightly larger JavaScript application, will inevitably face the different JS files between the reference, JS synchronous, asynchronous
Load and other requirements, this framework is to help us solve such problems.
OK, let's take a few of these frameworks to talk about.
PhoneGap
http://phonegap.com/
- Open source
- Write once, can be compiled to iOS, andriod, Win Phone ...
- Support GPS, camera, file system ... and other system interfaces
jQuery Mobile
Http://jquerymobile.com
If you're developing an app that's close to the native UI, a UI framework can save you a lot of time, and JQuery Mobile is
Such a UI framework.
- There is no absolute relationship with jquery, you can choose a different DOM selector
- The community is active and has been applied to practical development
- Although the operating efficiency is increasing, but it is still a bit slow, especially used on phonegap
Backbone.js
Backbone.js is a JavaScript-like MVC framework that you can use to mimic the MVC framework on the server side of Ruby on Rails, struts, and so on.
Of course, there may be some difference in the extent to which the MVC pattern is implemented.
- A small, popular MVC framework for writing large HTML5 applications
- They're using Backbone:linkin,soundcloud,basecamp,codiqa.
is the backbone MVC frame composition, when learning mvc, we should be exposed to a technology: template engine, because the model data needs to be displayed in the view,
The binder of the template engine is needed to glue the two together. Mustache is such a template interpretation engine
Mustache
- Support a wide variety of languages
- Simple, but very powerful.
- Support Loops
- You can use the Underscore.js template, but not strong enough
Require.js
- Modularization of JS Library
- Large Project Prerequisites
- Supports asynchronous loading-speeds up loading
- Support to compress multiple files into one file
Require.js + tempalte require.js Support loading text file, so can be used to load template file JS code
- Define (["backbone", "underscore", "jquery", "text!listview.html"],
- function (backbone,_,$,listviewtemplate) {...
- Mustache.render (Listviewtemplate,This.model.toJSON ()) ...
Summarize
Frame flying around, in the framework of the sea, fished out the frame you need, DRY (Dont Repeat yourself)
DEFINE([“BACKBONE”,“UNDERSCORE”,“JQUERY”,“TEXT!LISTVIEW.HTML”],FUNCTION(BACKBONE,_,$,LISTVIEWTEMPLATE){...MUSTACHE.RENDER(LISTVIEWTEmpLate,tHIs. Model. ToJSoN()) ... DEFINE([“BACKBONE”,“UNDERSCORE”,“JQUERY”,“TEXT!LISTVIEW.HTML”],FUNCTION(BACKBONE,_,$,LISTVIEWTEMPLATE){...MUSTACHE.RENDER(LISTVIEWTEmpl ate ,th is. Mode l. Tojs on ( ...
http://cavenfeng.iteye.com/blog/1551516
Build a full-stack HTML5 mobile application framework (pure dry, pro!) )