diff options
author | Gustavo Beathyate <gustavo@epiclabs.pe> | 2012-06-16 17:57:58 -0500 |
---|---|---|
committer | Gustavo Beathyate <gustavo@epiclabs.pe> | 2012-06-16 17:57:58 -0500 |
commit | 15a63052dc30e681a84f491264a8dbe8ec699158 (patch) | |
tree | c9bbc0d749d47485cc1ce1ee5500712175de97b6 /guides/source | |
parent | f20f230a588369a7876d5a7bc03efee3c3028200 (diff) | |
download | rails-15a63052dc30e681a84f491264a8dbe8ec699158.tar.gz rails-15a63052dc30e681a84f491264a8dbe8ec699158.tar.bz2 rails-15a63052dc30e681a84f491264a8dbe8ec699158.zip |
update DOM and HTML vs AJAX communication [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/ajax_on_rails.textile | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/guides/source/ajax_on_rails.textile b/guides/source/ajax_on_rails.textile index 224c318c99..1c502111d9 100644 --- a/guides/source/ajax_on_rails.textile +++ b/guides/source/ajax_on_rails.textile @@ -34,11 +34,21 @@ 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 +The DOM(Document Object Model) is a convention to represent HTML (or XML) +documents, as a set of nodes that act as objects and contain other nodes. You can +have a @div@ element that containsmother @div@ elements as well as @p@ elements +that contain text. h4. Standard HTML communication vs AJAX -How do 'standard' and AJAX requests differ, why does this matter for understanding AJAX on Rails (tie in for *_remote helpers, the next section) +In regular HTML comunications, when you click on a link, the browser makes an HTTP +@GET@ request, the server responds with a new HTML document that the browsers renders +and then replaces the previous one. The same thing happens when you click a button to +submit a form, except that you make and HTTP @POST@ request, but you also get a new +HTML document that the browser renders and replaces the current one. In AJAX +communications, the request is separate, and the response is evaluated in JavaScript +instead of rendered by the browser. That way you can have more control over the content +that gets returned, and the page is not reloaded. h3. Built-in Rails Helpers |