background preloader

Libraries

Facebook Twitter

Easel JS: A Javascript Library for Working with the HTML5 Canvas Element. Canvas3D & Flickr. Processing.js. Home. Prototype JavaScript Framework. Features[edit] Prototype provides various functions for developing JavaScript applications. The features range from programming shortcuts to major functions for dealing with XMLHttpRequest. Sample utility functions[edit] The $() function[edit] The dollar function, $(), can be used as shorthand for the getElementById function. To refer to an element in the Document Object Model (DOM) of an HTML page, the usual function identifying an element is: document.getElementById("id_of_element").style.color = "#ffffff"; The $() function reduces the code to: The $() function can also receive an element as parameter and will return, as in the previous example, a prototype extended object. var domElement = document.getElementById("id_of_element"); // Usual object reference returnedvar prototypeEnhancedDomElement = $(domElement); // Prototype extended object reference The $F() function[edit] Building on the $() function: the $F() function returns the value of the requested form element.

The $$() function[edit] RequireJS. The Problem§ 1 Web sites are turning into Web appsCode complexity grows as the site gets biggerAssembly gets harderDeveloper wants discrete JS files/modulesDeployment wants optimized code in just one or a few HTTP calls Solution§ 2 Front-end developers need a solution with: Some sort of #include/import/requireability to load nested dependenciesease of use for developer but then backed by an optimization tool that helps deployment Script Loading APIs§ 3 First thing to sort out is a script loading API.

Dojo: dojo.require("some.module")LABjs: $LAB.script("some/module.js")CommonJS: require("some/module") All of them map to loading some/path/some/module.js. We also want some sort of syntax that will allow loading plain JavaScript files that exist today -- a developer should not have to rewrite all of their JavaScript to get the benefits of script loading. However, we need something that works well in the browser. Async vs Sync§ 4 This example should illustrate the basic problem for the browser. Lettering.js - A jQuery plugin for radical web typography.