The script.aculo.us library by Thomas Fuchs (with numerous contributions from the community) is distributed in six files: scriptaculous.js, builder.js, effects.js, dragdrop.js, controls.js, and slider.js.[*] Including scriptaculous.js will automatically include the other five files, if they are in the same directory. Prototype (which script.aculo.us depends on) must be included separately.
<script src="/books/4/386/1/html/2//js/prototype.js" type="text/javascript"></script> <script src="/books/4/386/1/html/2//js/scriptaculous.js" type="text/javascript"></script> The standard Rails skeleton (as generated by rails myapp) includes effects.js, dragdrop.js, and controls.js in the public/javascripts directory. From within a Rails view or layout file, the javascript_include_tag helper can be used to include external JavaScript files. By passing it :defaults, it will include Prototype, the Rails-standard script.aculo.us files, and application.js, if present: <%= javascript_include_tag :defaults %> Demos, downloads, and announcements are available from the official web site (http://script.aculo.us). Documentation and example code are available from the official wiki (http://wiki.script.aculo.us). The script.aculo.us library (and this chapter) has seven major parts: visual effects, drag and drop, controls, element extensions, DOM builder, JavaScript unit testing, and miscellaneous utility methods. |