MochiKit

As soon as you access the MochiKit web site, once you get past the ubiquitous lime color, you see the words proudly proclaimed across the top:

MochiKit makes JavaScript suck less

In my opinion, if JavaScript sucked that much, it wouldn’t be used so extensively, and we wouldn’t have the rich set of libraries and frameworks, of which I’ve only provided a sample in this chapter. However, be that as it may, MochiKit has a nicely organized web site that makes it very easy to find demos, documentation, and code. As with other libraries, MochiKit functionality is packaged into several different behavioral and UI components, including:

  • MochiKit.Async: The Ajax component

  • MochiKit.Base: Foundation for the MochiKit framework

  • MochiKit.DOM: Wrapper around DOM functionality

  • MochiKit.DragAndDrop: The ever-present drag and drop

  • MochiKit.Color: CSS3 color abstraction

  • MochiKit.DateTime: Date and time functionality

  • MochiKit.Format: String formatting

  • MochiKit.Iter: Adds iteration capability

  • MochiKit.Logging: “We’re all tired of alert(  )”

  • MochiKit.LoggingPane: Interactive logging pane

  • MochiKit.Signal: Universal event handling

  • MochiKit.Style: CSS API

  • MochiKit.Sortable: Sortable effects

  • MochiKit.Visual: The usual visual effects, such as rounding, visibility, and opacity

There are several interesting modules, all worth exploring. But the one that caught my eye was “We’re all tired of alert(  )”.

I find that alert is handy to debug, but true, it isn’t the most efficient. I decided to ...

Get Learning JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.