Merge pull request #30435 from yhirano55/fix_grammer_in_guide_for_javascript
Fix grammar in JavaScript in Rails [ci skip]
This commit is contained in:
commit
62647ce417
@ -24,11 +24,11 @@ In order to understand Ajax, you must first understand what a web browser does
|
|||||||
normally.
|
normally.
|
||||||
|
|
||||||
When you type `http://localhost:3000` into your browser's address bar and hit
|
When you type `http://localhost:3000` into your browser's address bar and hit
|
||||||
'Go,' the browser (your 'client') makes a request to the server. It parses the
|
'Go', the browser (your 'client') makes a request to the server. It parses the
|
||||||
response, then fetches all associated assets, like JavaScript files,
|
response, then fetches all associated assets, like JavaScript files,
|
||||||
stylesheets and images. It then assembles the page. If you click a link, it
|
stylesheets and images. It then assembles the page. If you click a link, it
|
||||||
does the same process: fetch the page, fetch the assets, put it all together,
|
does the same process: fetch the page, fetch the assets, put it all together,
|
||||||
show you the results. This is called the 'request response cycle.'
|
show you the results. This is called the 'request response cycle'.
|
||||||
|
|
||||||
JavaScript can also make requests to the server, and parse the response. It
|
JavaScript can also make requests to the server, and parse the response. It
|
||||||
also has the ability to update information on the page. Combining these two
|
also has the ability to update information on the page. Combining these two
|
||||||
@ -57,7 +57,7 @@ will show you how Rails can help you write websites in this way, but it's
|
|||||||
all built on top of this fairly simple technique.
|
all built on top of this fairly simple technique.
|
||||||
|
|
||||||
Unobtrusive JavaScript
|
Unobtrusive JavaScript
|
||||||
-------------------------------------
|
----------------------
|
||||||
|
|
||||||
Rails uses a technique called "Unobtrusive JavaScript" to handle attaching
|
Rails uses a technique called "Unobtrusive JavaScript" to handle attaching
|
||||||
JavaScript to the DOM. This is generally considered to be a best-practice
|
JavaScript to the DOM. This is generally considered to be a best-practice
|
||||||
@ -139,7 +139,7 @@ JavaScript) in this style, and you can expect that many libraries will also
|
|||||||
follow this pattern.
|
follow this pattern.
|
||||||
|
|
||||||
Built-in Helpers
|
Built-in Helpers
|
||||||
----------------------
|
----------------
|
||||||
|
|
||||||
### Remote elements
|
### Remote elements
|
||||||
|
|
||||||
@ -372,9 +372,9 @@ is also useful for manipulating form data before serialization. The
|
|||||||
`ajax:beforeSend` event is also useful for adding custom request headers.
|
`ajax:beforeSend` event is also useful for adding custom request headers.
|
||||||
|
|
||||||
If you stop the `ajax:aborted:file` event, the default behavior of allowing the
|
If you stop the `ajax:aborted:file` event, the default behavior of allowing the
|
||||||
browser to submit the form via normal means (i.e. non-AJAX submission) will be
|
browser to submit the form via normal means (i.e. non-Ajax submission) will be
|
||||||
canceled and the form will not be submitted at all. This is useful for
|
canceled and the form will not be submitted at all. This is useful for
|
||||||
implementing your own AJAX file upload workaround.
|
implementing your own Ajax file upload workaround.
|
||||||
|
|
||||||
### Rails-ujs event handlers
|
### Rails-ujs event handlers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user