Skip to content

Commit

Permalink
Grammar tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
erik authored and djpowers committed Sep 16, 2014
1 parent 0c744e5 commit 29b64e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 4 additions & 5 deletions chapters/ajax/ajax_request_without_jquery.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Let's set up a simple test HTML page with a button.
<body>
<h1>XMLHttpRequest Tester</h1>
<button id="loadDataButton">Load Data</button>

<script type="text/javascript" src="XMLHttpRequest.js"></script>
</body>
</html>
Expand Down Expand Up @@ -53,7 +53,7 @@ loadDataFromServer = ->
console.log 'data message: ', data.message
else
console.log 'Error loading data...'

req.open 'GET', 'data.json', false
req.send()

Expand All @@ -63,7 +63,7 @@ loadDataButton.addEventListener 'click', loadDataFromServer, false

## Discussion

In the above code we essentially grab a handle to the button in our HTML (line 16) and add a *click* event listener (line 17). In our event listener, we define our callback function as loadDataFromServer.
In the above code we grab a handle to the button in our HTML (line 16) and add a *click* event listener (line 17). In our event listener, we define our callback function as loadDataFromServer.

We define our loadDataFromServer callback beginning on line 2.

Expand All @@ -77,7 +77,7 @@ The last thing we need to do is actually make our request.

Line 13 opens a 'GET' request to retrieve the data.json file.

Line 14 sends our request to the server.
Line 14 sends our request to the server.

## Older Browser Support

Expand All @@ -100,4 +100,3 @@ if (typeof @XMLHttpRequest == "undefined")
{% endhighlight %}

This code ensures the XMLHttpRequest object is available in the global namespace.

7 changes: 5 additions & 2 deletions chapters/arrays/define-ranges.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ There are two ways to define a range of array elements in CoffeeScript.

{% highlight coffeescript %}

# inclusive
myArray = [1..10]
# => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]

{% endhighlight %}

{% highlight coffeescript %}

# exclusive
myArray = [1...10]
# => [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

Expand All @@ -42,6 +44,7 @@ myLargeArray = [10...1]

## Discussion

Inclusive range always define by '..' operator.
Inclusive ranges are defined by the '..' operator and include the last value.

Exclusive ranges are defined by '...', and always omit the last value.

Exclusive range define by '...', and always omit the last value.

0 comments on commit 29b64e5

Please sign in to comment.