• 博客访问: 1047869
  • 博文数量: 526
  • 用 户 组: 普通用户
  • 注册时间: 1970-01-01 08:00
个人简介

鏆傛棤浠嬬粛

ITPUB论坛APP

ITPUB论坛APP



APP发帖 享双倍积分

文章分类

全部博文(526)

文章存档

2007年(3)

2006年(523)

我的朋友
微信关注

IT168企业级官微



微信号:IT168qiye



系统架构师大会



微信号:SACC2013

发布时间:2006-11-10 20:06:39

Rails的RJS模板-完 [@more@]14、pluck(variable, property) Iterates through the collection creating a new Array from the value of the given property of each object without a function call. The resulting Array is assigned to the JavaScript variable. # Ruby code page.select('.amounts').pluck('amounts', 'innerHTML') // Generated JavaScript var amounts = $$(".amounts").pluck("innerHTML"); 15、reject(variable){|value, index| block } Each element is pas......【阅读全文】

阅读(2442) | 评论(0) | 转发(0)

发布时间:2006-11-10 20:05:56

Rails的RJS模板二十五 [@more@]1、all(variable) {|value,index| block } Each element is passed to the block. The block is converted to a JavaScript iterator function. The JavaScript variable is set to TRue if the iterator function never returns false or null. 把每个元素传递给块。块被转换成 JavaScript 的 iterator 函数。如果iterator函数从不返回false或null,则JavaScript 变量被设置为true。 # Ruby code page.select('#line-items li').all('allVisible') do |value, index| value.visible end ......【阅读全文】

阅读(2525) | 评论(0) | 转发(0)

发布时间:2006-11-10 20:02:00

Rails的RJS模板二十四 [@more@]第二节 JavaScriptElementProxy JavaScriptElementProxy是一个对真正DOM对象的代理。你可以代理对DOM对象的任何JavaScript方法的调用。一些额外的方法已经被添加到proxy对象内以让它们更容易使用。该参考涉及了这些增强的非JavaScript方法。 The JavaScriptElementProxy is a proxy to a real DOM object. You can proxy method calls to the any of the DOM object's JavaScript methods. A few additional methods have been added to the proxy objects to make them more useful. This r......【阅读全文】

阅读(1448) | 评论(0) | 转发(0)

发布时间:2006-11-10 20:00:30

Rails的RJS模板二十三 [@more@]12、remove(id, ...) Removes one or more DOM elements from the page. 从页面上移除一个或多个DOM元素。 # Ruby code page.remove('first', 'second') // Generated JavaScript ["first", "second"].each(Element.remove); 13、replace(id, *options_for_render) Replaces the entire element specified or outerHTML. replace is useful with partial templates so that the entire partial, which includes a container element, can be rendered and ......【阅读全文】

阅读(1195) | 评论(0) | 转发(0)

发布时间:2006-11-10 19:56:58

第七章 RJS Reference [@more@]第六节 A Look Ahead As you can see from the Expense Tracker, it is almost too easy to implement complex Ajax features with Rails and RJS templates. The Expense Tracker just barely scratches the surface of what is possible. The RJS Reference section has examples of usage so you can master all aspects of RJS for your own projects. Have fun! 第七章 RJS Reference 这个参考部分涉及了由JavaScriptGenerator支持的所有方法,以及JavScriptElementPr......【阅读全文】

阅读(1715) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册