The Scripting Guide

What can I learn from this guide?

(intro)


Adding custom JavaScript to the application


Common objects

Prototype and Script.aculo.us are available on all pages.

visual.site, visual.page, visual.pageuser, visual.clientuser


Methods to manipulate the document structure

All JavaScript options are located inside the visual namespace.

visual.clip(actionElement, toElement, location); designed to move a given element to another part of the grid. For example "_tt_.clip('localnav', 'sidebar', 'top');" will locate the local navigation in the top of the sidebar.

visual.setText(cssIdentifier, text); allows you to easily change the text (or even the HTML) of a given object. For example, if you don't like the word "Linkroll", you can simply change it: visual.setText('#footer-linkroll .headline', 'My favorite links');

In addition to these method a few others are available in the visual namespace. They include, but are not limited to, visual.alert(message, onOK), visual.confirm(question, onYes, onNo), visual.prompt(question, defaultValue, onOK, onCancel), visual.modalDialog(contentDOMNode).


How does this work with the JavaScript API?