jQuery Overview

Using jQuery

The jQuery library can be included in any web page with this script declaration:

  <script type="text/javascript" 
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js">
  </script>

Here's the temperature conversion example using jQuery. Notice how there is no javascript mixed with the HTML.

Using jQuery with Rails

The base jQuery library is included in Rails 3.1. Additional libraries may be included (e.g. jQuery UI) by editing the assets/javascripts/application.js file. For example, adding this line will include the jQuery UI library:

  //= require jquery-ui