Section 14.2. Introduction to MochiKit and Its Interactive Shell

14.2. Introduction to MochiKit and Its Interactive Shell

The TurboGears philosophy is to not shy away from JavaScript. After all, it is the language spoken by the browsers. Knowing a little JavaScript can help you tremendously when you need to work on something a little outside the features the framework gives you for free. As you can see in the examples in this chapter, MochiKit makes the move from Python to JavaScript a little more seamless, in addition to providing some high-level tools and cross-browser compatibility.

MochiKit is broken down into several modules:

  • Async For handling asynchronous things, such as Ajax.

  • Base- Functional programming, comparisons, and other core functions.

  • DOM Manipulation of the Document Object Model (DOM), for doing things such as dynamically adding or updating the page.

  • Color Ability to work with colors and translate color values between different schemes.

  • DateTime Conveniences for working with (surprise!) dates and times.

  • DragAndDrop Functions for adding drag-and-drop behavior to your applications.

  • Format Functions for getting formatted strings.

  • Iter Python-style iteration for JavaScript.

  • Logging A better solution than alert() for debugging.

  • LoggingPane Interactive pane for viewing log messages.

  • Signal Universal event handling.

  • Sortable Provides drag-and-drop sorting of DOM elements.

  • Style Functions that help in working dynamically with CSS styles.

  • Visual Provides a way to create more advanced visual effects.

This chapter is not a JavaScript reference or tutorial. Many excellent books are available to help you learn the JavaScript language and the web browser programming environment.

Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: