20.2Snippets and Brushes
Adding JavaScript code to your Seaside application is not much different from rendering plain XHTML. You need to
- ask the rendering canvas
html prototype
to instantiate a Prototype or script.aculo.us brush, - configure the newly created brush with a cascade of configuration messages, and
- add the brush to the XHTML output. This will embed the JavaScript snippet at the desired place into the XHTML output stream.
In the following paragraphs we are going to have a in-depth look at these 3 steps and all the possibilities that Scriptaculous is providing. To directly dive into a running example, skip this section and continue with Section 20.3. To learn about the details you can always come back later.