Chapter 4. Introducing script.aculo.us

简介:

Chapter 4. Introducing script.aculo.us

上一章大部分内容是关于使用RailshelperPrototype的结合。这章,我们来转移下注意力到script.aculo.us上来,Railshelper也使用script.aculo.us来提供绚丽的视觉效果过度和强大的拖拽功能。
Prototype script.aculo.us的关系是非常紧密的。他们都和Rails共同工作,他们有非常相似的代码风格和API。事实上现在的很多script.aculo.us都是Prototype的最初原型。不论这二者之间有什么紧密关系,这两个资源库具有不同的目标。Prototype是为了扩展JavaScript而设计的,它拥有JavaScript语言的核心部分所具有的特征,例如提供了便于实现数据结构、DOM交互、轻松的Ajax调用等方法。而script.aculo.us工作在一个更高的层次,更接近于应用程序和用户界面,提供建立在Prototype基础之上的方法。有些情况下,这些方法非常复杂但是实现起来只需要几行代码。
在这一章,我们会举些例子来讲述,所以下面在Rails应用中生成一个controller和一个action
script/generate controller chapter4 index
现在,我们来瞧瞧 script.aculo.us  最出名的视觉效果吧!




本文转自 fsjoy1983 51CTO博客,原文链接:http://blog.51cto.com/fsjoy/91481,如需转载请自行联系原作者
目录
相关文章
|
7月前
|
JavaScript 索引
Component name “index“ should always be multi-word vue/multi-word-component-names
Component name “index“ should always be multi-word vue/multi-word-component-names
|
8月前
|
JavaScript
error Component name “Login“ should always be multi-word vue/multi-word-component-names【已解决】
error Component name “Login“ should always be multi-word vue/multi-word-component-names【已解决】
501 1
|
9月前
|
前端开发 图形学
Could you provide some examples of when Canvas or SVG would be the better choice for a web application?
Could you provide some examples of when Canvas or SVG would be the better choice for a web application
|
9月前
|
JavaScript
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
|
9月前
|
编解码 JavaScript 编译器
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
|
JavaScript
Vue中遇到的Bug( Component name “School“ should always be multi-word vue/multi-word-component-names)
Vue中遇到的Bug( Component name “School“ should always be multi-word vue/multi-word-component-names)
159 0
使用antd-theme-webpack-plugin报错Error LessError: Cannot find module ‘antd/lib/style/themes/default.less
使用antd-theme-webpack-plugin报错Error LessError: Cannot find module ‘antd/lib/style/themes/default.less
1164 0
使用antd-theme-webpack-plugin报错Error LessError: Cannot find module ‘antd/lib/style/themes/default.less
es6 basic intro
es6 basic intro
104 0
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as t
vue.js报错如下: - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
5675 1