當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
诗歌rials 之RJS的tips
生活随笔
收集整理的這篇文章主要介紹了
诗歌rials 之RJS的tips
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一些RJS的tips
ruby代碼#?do_magic.rjs?? page[:reviews].toggle?? ?? page[:review_name].value?=?"this?is?cool"?? ?? page?<<?"if?($('review_name').value?==?'foo')?("?? page.alert('hi?foo!')?? page?<<?")"?? ?? page.select("#reviews?strong").each?do?|element|?? ??element.visual_effect?:highlight?? end?? # do_magic.rjs page[:reviews].toggle page[:review_name].value = "this is cool" page << "if ($('review_name').value == 'foo') (" page.alert('hi foo!') page << ")" page.select("#reviews strong").each do |element| element.visual_effect :highlight end 在頁面中我們也可以使用link_to_function來直接寫rjs:
ruby代碼<%=?? link_to_function?"Show?me?the?Magic!"?do?|page|?? ??page.select("#reviews?strong").each?do?|element|?? ????element.visual_effect?:highlight?? ??end?? end?? %>?? <%= link_to_function "Show me the Magic!" do |page| page.select("#reviews strong").each do |element| element.visual_effect :highlight end end %>
ruby代碼
ruby代碼
轉載于:https://www.cnblogs.com/orez88/articles/1519627.html
總結
以上是生活随笔為你收集整理的诗歌rials 之RJS的tips的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: FileUtils入门使用
- 下一篇: 十天学会ASP.Net——(8)