<commit_before>h2. AJAX on Rails

This guide covers the built-in Ajax/JavaScript functionality of Rails (and more); it will enable you to create rich and dynamic AJAX applications with ease! We will cover the following topics:

* Quick introduction to AJAX and related technologies
* Unobtrusive JavaScript helpers with drivers for Prototype, jQuery etc
* Testing JavaScript functionality

endprologue.

h3. Hello AJAX - a Quick Intro

You'll need the basics of DOM, HTTP requests and other topics discussed here to really understand Ajax on Rails.

h4. Asynchronous JavaScript + XML

Basic terminology, new style of creating web apps

h4. The DOM

basics of the DOM, how is it built, properties, features, why is it central to AJAX<commit_msg>update AJAX guide intro [ci skip]<commit_after>h2. AJAX on Rails

This guide covers the built-in Ajax/JavaScript functionality of Rails (and more); it will enable you to create rich and dynamic AJAX applications with ease! We will cover the following topics:

* Quick introduction to AJAX and related technologies
* Unobtrusive JavaScript helpers with drivers for Prototype, jQuery etc
* Testing JavaScript functionality

endprologue.

h3. Hello AJAX - a Quick Intro

AJAX is about updating parts of a web page, without reloading the page. An AJAX call happens as a
response to an event, like when the page finished loading or when a user clicks on an element. For
example, let say you click on a link, which would usually take you to a new page, but instead of
doing that, an asynchronous HTTP request is made and the response is evaluated with javascript.
That way the page is not reloaded, and new information can be dynamically included in the page.
The way that happens is by inserting, removing or changing parts of the DOM. The DOM, or
Document Object Model, is a convention to represent the HTML document as a set of nodes that contain
other nodes. For example a list of names is represented as a @ul@ element node containing several
@li@ element nodess. An AJAX call can be made to obtain a new list item to include, and append it
inside a @li@ node to the @ul@ node.

h4. Asynchronous JavaScript + XML

AJAX means Asynchronous JavaScript + XML. Asynchronous means that the page is not reloaded, the
request made is separate from the regular page request. Javascript is used to evaluate the response
and the XML part is a bit misleading as XML is not required, you respond to the HTTP request with
JSON or regular HTML as well. 

h4. The DOM

basics of the DOM, how is it built, properties, features, why is it central to AJAX
{'fraction_non_alphanumeric': 0.03450949980612641, 'fraction_numerical': 0.0031019775106630476, 'mean_word_length': 4.363825363825364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5918703', 'n_tokens_mistral': 675, 'n_tokens_neox': 631, 'n_words': 423}