
Elgg 1.8 introduced a JavaScript engine that complements the PHP engine. Plugins can use built-in features of the JS engine to quickly AJAXify parts of their interfaces, use lightboxes, toggle visibility for elements, and much more without writing much (or any) JS. The JS engine can also includes a system of hooks similar to the PHP engine that allows plugins to extend functionality.
The engine is tightly bundled with jQuery, and uses many of jQuery's features.
All of the engine is namespaced under the `elgg` object. Plugin developers are encouraged to namespace their plugin's JS under elgg.<plugin_id>.
The majority of the JS engine lives in /js/ and is fairly well documented in code. Many of the bundled plugins use JS features. As outlined on the Plugin skeleton page, bundled plugins will keep their JS either in the <plugin_id>/js/ directory, or in the <plugin_id>/js view.
Always look to the core code for pointers, tips, and best practices.