1. Caching multiple javascript into one
javascript_include_tag :all, :cache => true
javascript_include_tag "prototype", "cart", "checkout", :cache => "shop"
2. jQuery
jQuery
is a fast and concise JavaScript Library that simplifies HTML
document traversing, event handling, animating, and Ajax interactions
for rapid web development. jQuery is designed to change the way that you write JavaScript.
Rails默认使用的ajax框架是prototype,结合prototype,Rails提供了一些非常方便的prototype
helper方法,比如:remote_form等。如果在Rails中选择使用jQuery库,不用担心使用不了这些helper方法,因为jRails
为这些方法提供了jQuery版本。
jRails is a drop-in jQuery
replacement for Prototype
/script.aculo.us
on Rails.
Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.
用jQuery实现的一些工具也很好用,比如greybox
。
3. prototype helper methods
It's strong by providing lots of helper method like observe_field, with lots of options like :success, :condition, :before.
如果使用JQuery,也不需要担心这些方法没法使用。JRails
为这些方法实现了JQuery版本。
4. jquery的$(document).ready()
与window.onload的区别 : $(document).ready()是在DOM结构载入完后执行的,而window.onload是在所有文件
都加载完后执行的。
5. jquery的serialize
Serializes a set of input elements into a string of data. http://docs.jquery.com/Ajax/serialize
分享到:
相关推荐
6. **Asset Pipeline**:Rails的Asset Pipeline处理CSS、JavaScript和图片等静态资源,支持Sass、CoffeeScript等预处理器,提高开发效率。 7. **Action Cable**:Rails 5引入了Action Cable,实现了WebSockets,...
修复列表和显示视图(适当的标签,例如工资(货币/每周/每月?)) 获得第二种字体来修饰某些东西,为其他所有东西尝试另一种字体 将截止日期作为作业的属性添加 根据截止日期对工作进行排序 根据最新对公司进行...
Ironhack 练习和每周工作。第 0 周在您的计算机上设置开发环境以使用 Ruby 和 Rails 进行 Web 开发能够创建基于 HTML5 的网页了解如何使用 Google Chrome 团队提供给您的秘密武器来调试 CSS 问题使用 Unix 命令行...
【标题】中的知识点主要涉及到的是一个基于Web的教会平台,其核心功能是为教会成员提供上传和收听每周讲道的服务。这样的系统通常需要具备音频上传、存储、播放以及用户管理的功能。此外,还提到该平台能够发布新闻...
Node.js 是一种基于 Chrome V8 引擎的 JavaScript 运行时环境,它使得开发者可以在服务器端使用 JavaScript,实现全栈开发。Node.js 的主要特点是轻量、高效、可扩展性强,尤其适合构建实时交互的 web 应用,如协作...
您的锻炼总数的每周和每月摘要。 安装 git clone git://github.com/anolson/interval.git 入门 $ rm public/index.html $ cp config/database.yml.example config/database.yml $ cp config/initi