Writing Modular JavaScript

  • Reviews:

$5,00

Descrição

When writing an entire web application in JavaScript, it’s very important to have well-organized code; maintaining a spaghetti-coded project will only cause you headaches and nightmares. In this tutorial, I’ll show you how to modularize your code to make it easier to manage large JavaScript projects.

I was inspired to write this tutorial after watching a presentation entitled “Scalable JavaScript Application Architecture” by Nicolas C. Zakas (available on the YUI Theater). We’ll take the theoretical code that he showed in his slides and extend and customize it to create a robust JavaScript system that will make it incredibly easy to build web apps on top of.

We’ll start by defining our modules; then, we’ll build a sandbox for them to interact with. We’ll also need a core to handle the modules, and a base (a JS framework) that gives the core an equalized environment to work on. We’ll build our first core on jQuery, and then build an alternate core on Dojo.

We’ll conclude this tutorial by discussing what the benefits and downsides of using such an architecture for JavaScript are.

Informação adicional

Compatible Browsers

Chrome 4, Chrome 5, Firefox, IE8, Opera, Safari

Demo Url

http://www.andrewburgess.ca/modular_javascript

Difficulty

Intermediate

Js Library

jQuery

Tutorial Files Included

.CSS Files, .HTML Files, .MP4, JavaScript JS

Video Preview Resolution

1280×800

Compartilhe