Skip to Main Content
JavaScript Web Applications
book

JavaScript Web Applications

by Alex MacCaw
August 2011
Intermediate to advanced content levelIntermediate to advanced
276 pages
6h 37m
English
O'Reilly Media, Inc.
Content preview from JavaScript Web Applications

Chapter 13. The JavascriptMVC Library

Justin Meyer, the author of JavaScriptMVC, kindly contributed this chapter

JavaScriptMVC (JMVC) is an open source jQuery-based JavaScript framework. It is nearly a comprehensive (holistic) frontend development framework, packaging utilities for testing, dependency management, documentation, and a host of useful jQuery plug-ins.

Yet every part of JavaScriptMVC can be used without every other part, making the library lightweight. Its class, model, view, and controller combined are only 7k minified and compressed, yet even they can be used independently. JavaScriptMVC’s independence lets you start small and scale to meet the challenges of the most complex applications on the Web.

This chapter covers JavaScriptMVC’s $.Class, $.Model, $.View, and $.Controller. The following describes each component:

$.Class

The JavaScript-based class system

$.Model

The traditional model layer

$.View

The client-side template system

$.Controller

The jQuery widget factory

JavaScriptMVC’s naming conventions deviate slightly from the traditional Model-View-Controller design pattern. For example, $.Controller is used to create traditional view controls, like pagination buttons and lists, as well as traditional controllers that coordinate between the traditional views and models.

Setup

JavaScriptMVC can be used as a single download that includes the entire framework. But since this chapter covers only the MVC parts, go to the download builder; check Controller, Model, and View’s EJS ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript Application Design

JavaScript Application Design

Nicolas Bevacqua
JavaScript: Best Practice

JavaScript: Best Practice

James Kolce, Moritz Kroger, Ivan Curic, Samier Saeed, Jeff Mott, M. David Green, Craig Buckler

Publisher Resources

ISBN: 9781449308216Errata PageSupplemental Content