Skip to content

Commit 2538ad9

Browse files
Markus Amalthea Magnusongnarf
Markus Amalthea Magnuson
authored andcommitted
Typo/spelling corrections from @alimony - Closes jquery#266 - Closes jquery#265 - Closes jquery#264 - Closes jquery#263
Squashed commit of the following: commit: 32cec8f Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:52:08 2013 +0100 Fix space before new sentence in two places. commit 42bce3b Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:42:53 2013 +0100 andif -> and if commit ee2dee2 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:42:12 2013 +0100 Fix a few typos. commit 1c350ed Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:37:01 2013 +0100 milleseconds -> milliseconds commit 6a9d4e3 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:35:29 2013 +0100 availble -> available commit 0ac8be2 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:33:11 2013 +0100 recieve -> receive commit 005c7f6 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:30:35 2013 +0100 Fix a couple of typos. commit c866fd9 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:26:46 2013 +0100 simpiler -> simpler commit 3a446fd Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:12:00 2013 +0100 doesn"t -> doesn't commit 66ac8e8 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:10:03 2013 +0100 inconsist -> inconsistent commit ffb9496 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 01:00:38 2013 +0100 Fix Selecing -> Selecting and space after // commit f216fa6 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:56:55 2013 +0100 wfirst -> first commit c3c79dd Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:43:36 2013 +0100 falsey -> falsy commit 734b35e Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:39:24 2013 +0100 Fix a couple of typos. commit e7247e7 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:21:17 2013 +0100 Fix a few typos. commit 217e621 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:18:32 2013 +0100 Fix a couple of typos. commit 05db7f0 Author: Markus Amalthea Magnuson <markus.magnuson@gmail.com> Date: Sat Feb 23 00:16:09 2013 +0100 Fix a couple of typos.
1 parent 5b6aaf6 commit 2538ad9

18 files changed

+30
-30
lines changed

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ there's always more to refine and add, and we need your help too!
4747

4848
Of course, we'll also give you credit for your work! The **Contributors** section
4949
for each article is generated from the git commit logs on the file, so you'll
50-
be publicly acknolwedged for your help.
50+
be publicly acknowledged for your help.
5151

5252
## How Does It Work?
5353

@@ -137,7 +137,7 @@ Once you've gotten your environment working, here are the general steps you shou
137137
8. Go to your fork on GitHub and submit a new [pull request](https://help.github.com/articles/using-pull-requests).
138138

139139
For more advice on managing your fork and submitting pull requests to jQuery
140-
Foundation, read our [Committs and Pull
140+
Foundation, read our [Commits and Pull
141141
Requests](http://contribute.jquery.org/commits-and-pull-requests/) guide.
142142

143143
### Adding A New Article

page/code-organization/deferreds.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ promise.then( function( futureValue ) {
7272
In the case of certain applications, it is necessary to have several
7373
results returned before your application can continue at all (for
7474
example, displaying a dynamic set of options on a screen before a user
75-
is able to select the option that interests them).Where this is the
75+
is able to select the option that interests them). Where this is the
7676
case, a method called 'when' exists, which can be used to perform some
7777
action once all the promises have been fully fulfilled:
7878

page/effects/intro-to-effects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $("p").hide( 500 );
4141
$("div.hidden").show( 1250 );
4242
```
4343

44-
Most developers pass in a number of milleseconds to have more precise control
44+
Most developers pass in a number of milliseconds to have more precise control
4545
over the duration.
4646

4747
##Fade and Slide Animations

page/effects/queue-and-dequeue-explained.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source: http://jqueryfordesigners.com/api-queue-dequeue/
55
---
66

77
When you use the animate and show, hide, slideUp, etc effect methods, you’re
8-
adding a job on to the fx queue.By default, using queue and passing a function,
8+
adding a job on to the fx queue. By default, using queue and passing a function,
99
will add to the fx queue. So we’re creating our own bespoke animation step:
1010

1111
```

page/events/event-delegation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ $("#list").on( "click", "a", function( event ) {
8989
```
9090
This simply passes the `.is()` method a selector to see if the element"s `href` attributes starts with "http". Also we have removed the `event.preventDefault();` statement, this is because we want the default action to happen (which is to following the `href`)
9191

92-
We can actually take this a step further and make our code simpiler and more concise by allowing the selector argument to `.on()` do our logic for us.
92+
We can actually take this a step further and make our code simpler and more concise by allowing the selector argument to `.on()` do our logic for us.
9393
```
9494
// attach a delegated event with a more refined selector
9595
$("#list").on( "click", "a[href^=http]", function( event ) {

page/events/event-extensions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ props: Array
4444
: Strings representing properties that should be copied from the browser's event object to the jQuery event object. If omitted, no additional properties are copied beyond the standard ones that jQuery copies and normalizes (e.g., `event.target` and `event.relatedTarget`).
4545

4646
filter: Function( event, originalEvent )
47-
: jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also availble in `event.originalEvent`.
47+
: jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also available in `event.originalEvent`.
4848

4949
Note that for all events, the browser's native event object is available in `event.originalEvent`; if the jQuery event handler examines the properties there instead of jQuery's normalized `event` object, there is no need to create a `fixHooks` entry to copy or modify the properties.
5050

page/events/history-of-events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ When we use `.live()` our event is bound to `$( document )`. When the `<li>` is
7070
* `<html>`
7171
* *document* root
7272

73-
The last element to recieve the *click* event is *document*, this is where our `.live()` event is bound. `.live()` will then check to see if our selector `#list li` is the element that triggered the event, if so our event handler is executed.
73+
The last element to receive the *click* event is *document*, this is where our `.live()` event is bound. `.live()` will then check to see if our selector `#list li` is the element that triggered the event, if so our event handler is executed.
7474

7575

7676
### [.live()](http://api.jquery.com/live/) w/ context (Deprecated)

page/events/introduction-to-events.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The event we want to listen to is specified by the button's `onclick` attribute,
3333
1. First, we're coupling our view code (HTML) with our interaction code (JS). That means that whenever we need to update functionality, we'd have to edit our HTML which is just a bad practice and a maintenance nightmare.
3434
2. Second, it's not scalable. If you had to attach this functionality onto numerous buttons, you'd not only bloat the page with a bunch of repetitious code, but you would again destroy maintainability.
3535

36-
Utilizing inline event handlers like this can be considered *obtrusive JavaScript,* but its opposite, *unobtrustive JavaScript* is a much more common way of discussing the topic. The notion of *unobtrusive JavaScript* is that your HTML and JS are kept separate and are therefore more maintainable. Separation of concerns is important because it keeps like pieces of code together (ie HTML, JS, CSS) and unlike pieces of code apart, facilitating changes, enhancements, etc. Furthermore, unobtrustive JavaScript stresses the importance of adding the least amount of cruft to a page as possible. If a user's browser doesn't support JavaScript, then it shouldn't be intertwined into the markup of the page. Also, to prevent naming collisions, JS code should utilize a single namespace for different pieces of functionality or libraries. jQuery is a good example of this, in that the `jQuery` object/constructor (and also the `$` alias to `jQuery`) only utilizes a single global variable, and all of jQuery's functionality is packaged into that one object.
36+
Utilizing inline event handlers like this can be considered *obtrusive JavaScript,* but its opposite, *unobtrusive JavaScript* is a much more common way of discussing the topic. The notion of *unobtrusive JavaScript* is that your HTML and JS are kept separate and are therefore more maintainable. Separation of concerns is important because it keeps like pieces of code together (i.e. HTML, JS, CSS) and unlike pieces of code apart, facilitating changes, enhancements, etc. Furthermore, unobtrusive JavaScript stresses the importance of adding the least amount of cruft to a page as possible. If a user's browser doesn't support JavaScript, then it shouldn't be intertwined into the markup of the page. Also, to prevent naming collisions, JS code should utilize a single namespace for different pieces of functionality or libraries. jQuery is a good example of this, in that the `jQuery` object/constructor (and also the `$` alias to `jQuery`) only utilizes a single global variable, and all of jQuery's functionality is packaged into that one object.
3737

3838
To accomplish the desired task unobtrusively, let's change our HTML a little bit by removing the `onclick` attribute and replacing it with an `id`, which we'll utilize to "hook onto" the button from within a script file.
3939

@@ -118,7 +118,7 @@ As of jQuery 1.7, all events are bound via the `on` method, whether you call it
118118

119119
Let's look at the `on` examples from above and discuss their differences. In the first example, a string of `click` is passed as the first argument to the `on` method, and an anonymous function is passed as the second. This looks a lot like the `bind` method before it. Here, we're attaching an event handler directly to `#helloBtn`. If there were any other buttons on the page, they wouldn't alert "Hello" when clicked because the event is only attached to `#helloBtn`.
120120

121-
In the second `on` example, we're passing an object (denoted by the curly braces `{}`), which has a property of `click` whose value is an anonymous function. The second argument to the `on` method is a jQuery selector string of `button`. While examples 1–3 are functionally equivalent, example 4 is different in that the `body` element is listening for click events that occur on *any* button element, not just `#helloBtn`. The final example above is exactly the same as the one preceding it, but instead of passing an object, we pass an event string, a selector string, and the callback. Both of these are examples of event delegation, a process by which an element higher in the DOM tree listens for events occuring on its children.
121+
In the second `on` example, we're passing an object (denoted by the curly braces `{}`), which has a property of `click` whose value is an anonymous function. The second argument to the `on` method is a jQuery selector string of `button`. While examples 1–3 are functionally equivalent, example 4 is different in that the `body` element is listening for click events that occur on *any* button element, not just `#helloBtn`. The final example above is exactly the same as the one preceding it, but instead of passing an object, we pass an event string, a selector string, and the callback. Both of these are examples of event delegation, a process by which an element higher in the DOM tree listens for events occurring on its children.
122122

123123
Event delegation works because of the notion of *event bubbling*. For most events, whenever something occurs on a page (like an element is clicked), the event travels from the element it occurred on, up to its parent, then up to the parent's parent, and so on, until it reaches the root element, aka the `window`. So in our table example, whenever a `td` is clicked, its parent `tr` would also be notified of the click, the parent `table` would be notified, the `body` would be notified, and ultimately the `window` would be notified as well. While event bubbling and delegation work well, the delegating element (in our example, the `table`) should always be as close to the delegatees as possible so the event doesn't have to travel way up the DOM tree before its handler function is called.
124124

@@ -144,7 +144,7 @@ $("#helloBtn").on( "click", sayHello );
144144

145145
In this slightly different example, we're defining a function called `sayHello` and then passing that function into the `on` method instead of an anonymous function. So many online examples show anonymous functions used as event handlers, but it's important to realize that you can also pass defined functions as event handlers as well. This is important if different elements or different events should perform the same functionality. This helps to keep your code DRY.
146146

147-
But what about that `event` argument in the `sayHello` function—what is it and why does it matter? In all DOM event callbacks, jQuery passes an *event object* argument which contains information about the event, such as precisely when and where it occurred, what type of event it was, which element the event occured on, and a plethora of other information. Of course you don't have to call it `event`; you could call it `e` or whatever you want to, but `event` is a pretty common convention.
147+
But what about that `event` argument in the `sayHello` function—what is it and why does it matter? In all DOM event callbacks, jQuery passes an *event object* argument which contains information about the event, such as precisely when and where it occurred, what type of event it was, which element the event occurred on, and a plethora of other information. Of course you don't have to call it `event`; you could call it `e` or whatever you want to, but `event` is a pretty common convention.
148148

149149
If the element has default functionality for a specific event (like a link opens a new page, a button in a form submits the form, etc), that default functionality can be cancelled. This is often useful for AJAX requests. When a user clicks on a button to submit a form via AJAX, we'd want to cancel the button/form's default action (to submit it to the form's `action` attribute), and we would instead do an AJAX request to accomplish the same task for a more seamless experience. To do this, we would utilize the event object and call its `preventDefault` method. We can also prevent the event from bubbling up the DOM tree using `stopPropagation` so that parent elements aren't notified of its occurrence (in the case that event delegation is being used).
150150

page/events/triggering-event-handlers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $("a").trigger("click");
3030
## How can I mimic a native browser event, if not `.trigger()`?
3131

3232
In order to trigger a native browser event, you have to use [document.createEventObject](http://msdn.microsoft.com/en-us/library/ie/ms536390%28v=vs.85%29.aspx) for < IE9 and [document.createEvent](https://developer.mozilla.org/en/DOM/document.createEvent) for all other browsers.
33-
Using these two APIs, you can programatically create an event that behaves exactly as if someone has actually clicked on a file input box. The default action will happen, and the browse file dialog will display.
33+
Using these two APIs, you can programmatically create an event that behaves exactly as if someone has actually clicked on a file input box. The default action will happen, and the browse file dialog will display.
3434

3535
The jQuery UI Team created [jquery.simulate.js](https://github.com/eduardolundgren/jquery-simulate/blob/master/jquery.simulate.js) in order to simplify triggering a native browser event for use in their automated testing. Its usage is modeled after jQuery's trigger.
3636

@@ -49,7 +49,7 @@ There are four differences between `.trigger()` and `.triggerHandler()`
4949
1. `.triggerHandler()` only triggers the event on the first element of a jQuery object.
5050
2. `.triggerHandler()` cannot be chained. It returns the value that is returned by the last handler, not a jQuery object.
5151
3. `.triggerHandler()` will not cause the default behavior of the event (such as a form submission).
52-
4. Events triggered by `.triggerHandler()`, will not bubble up the DOM heirarchy. Only the handlers on the single element will fire.
52+
4. Events triggered by `.triggerHandler()`, will not bubble up the DOM hierarchy. Only the handlers on the single element will fire.
5353

5454
For more information see the [triggerHandler documentation](http://api.jquery.com/triggerHandler)
5555

page/javascript-101/loops.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ for ( [initialisation]; [conditional]; [iteration] ) {
3333

3434
The _initialisation_ statement is executed only once, before the loop starts. It gives you an opportunity to prepare or declare any variables.
3535

36-
The _conditional_ statement is executed before each iteration, and its return value decides whether the loop is to continue. If the conditional statement evaluates to a falsey value, then the loop stops.
36+
The _conditional_ statement is executed before each iteration, and its return value decides whether the loop is to continue. If the conditional statement evaluates to a falsy value, then the loop stops.
3737

3838
The _iteration_ statement is executed at the end of each iteration and gives you an opportunity to change the state of important variables. Typically, this will involve incrementing or decrementing a counter and thus bringing the loop closer to its end.
3939

page/javascript-101/syntax-basics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ JavaScript has support for single and multi-line comments. Comments are ignored
2424

2525
### Whitespace
2626

27-
Whitespace is also ignored in JavaScript. There are many tools that will strip out all the whitespace in a program, reducing the overall file size and improving network latency. Given the availability of tools like these, whitespace should be leveraged to make the code as readible as possible.
27+
Whitespace is also ignored in JavaScript. There are many tools that will strip out all the whitespace in a program, reducing the overall file size and improving network latency. Given the availability of tools like these, whitespace should be leveraged to make the code as readable as possible.
2828

2929
```
3030
// Whitespace is insignificant.
@@ -64,7 +64,7 @@ Identifiers are used to give variables and functions a unique name so they can s
6464
* Can only be composed of letters, numbers, dollar signs, and underscores.
6565
* The first character cannot be a number.
6666

67-
It's a best practice to name identifers in a way that will make sense to you and other developers later on.
67+
It's a best practice to name identifiers in a way that will make sense to you and other developers later on.
6868

6969
```
7070
// Valid identifier names.

page/plugins/advanced-plugin-concepts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ $.fn.hilight = function( options ) {
189189
190190
// build element specific options
191191
// This changed line tests to see if the Metadata Plugin is installed,
192-
// andif it is, it extends our options object with the extracted metadata.
192+
// and if it is, it extends our options object with the extracted metadata.
193193
var o = $.meta ? $.extend( {}, opts, $this.data() ) : opts;
194194
195195
//...

page/plugins/basic-plugin-creation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Notice that to use `css()`, another method, we use `this`, not `$( this )`. This
3737

3838
##Chaining
3939

40-
This works, but there's a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there are a few exeptions: `width()` called without parameters returns the width of the selected element, and is not chainable). Making our plugin method chainable takes one line of code:
40+
This works, but there's a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there are a few exceptions: `width()` called without parameters returns the width of the selected element, and is not chainable). Making our plugin method chainable takes one line of code:
4141

4242
```
4343
$.fn.greenify = function() {
@@ -127,7 +127,7 @@ It would be much better to have one slot, and use parameters to control what act
127127

128128
## Using the `each()` Method
129129
Your typical jQuery object will contain references to any number of DOM elements, and that's why jQuery objects are often referred to as collections.
130-
If you want to do any manipulating with specific elements (eg: getting data an attribute, calculating specific positions) then you need to use `each()` to
130+
If you want to do any manipulating with specific elements (e.g. getting data an attribute, calculating specific positions) then you need to use `each()` to
131131
loop through the elements.
132132

133133
```
@@ -182,7 +182,7 @@ $("div").greenify({
182182
});
183183
```
184184

185-
The default value for `color` of `#556B2F` gets overriden by `$.extend()` to be orange.
185+
The default value for `color` of `#556B2F` gets overridden by `$.extend()` to be orange.
186186

187187
##Putting It Together
188188

0 commit comments

Comments
 (0)