Chapter 11. script.aculo.us Reference


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.

[*] This chapter covers version 1.6.1.

<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.




Ajax on Rails
Ajax on Rails
ISBN: 0596527446
EAN: 2147483647
Year: 2006
Pages: 103
Authors: Scott Raymond

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net