Skip to content

Commit ab948ef

Browse files
k-riscajpiano
authored andcommitted
Typo fixes in several articles from @k-risc. Fixes jquery#244. Fixes jquery#245. Fixes jquery#246.
1 parent 547df86 commit ab948ef

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

page/events/event-delegation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Say you have to add new line items to your page, given the following HTML:
3131
</html>
3232
```
3333

34-
We need to attach the same event handler to multiple elements. In this example we want to attach an event that will the log the text of the anchor tag to the console whenever it is clicked.
34+
We need to attach the same event handler to multiple elements. In this example we want to attach an event that will log the text of the anchor tag to the console whenever it is clicked.
3535

3636
We can attach a direct bind click event to each `<li>` using the `.on()` method, that will alert the text inside of it by doing the following:
3737
```
@@ -45,7 +45,7 @@ $("#list a").on( "click", function( event ) {
4545
While this works perfectly fine, there are drawbacks. Consider this:
4646
```
4747
// add a new element on to our existing list
48-
$("#list").append("<li><a href="http://newsite.com">Item #101</a></li>");
48+
$("#list").append("<li><a href=\"http://newsite.com\">Item #101</a></li>");
4949
```
5050
If we were to click our newly added item, nothing would happen. This is because of the directly bound event that we attached previously. Direct events are only attached to elements at the time we called the `.on()` method for our existing collection of `<a>`"s, that is only the `<a>`"s that were found when we call `$()`
5151

page/events/triggering-event-handlers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jQuery's event handling system is a layer on top of native browser events. When
1616
reference to that handler when it is originally added. Additionally, it will trigger the javascript inside the
1717
"onclick" attribute. The `.trigger()` function cannot be used to mimic native browser events, such as
1818
clicking on a file input box or an anchor tag. This is because, there is no event handler attached using jQuery's
19-
event system that coorespond to these events.
19+
event system that corresponds to these events.
2020

2121
```
2222
<a href="http://learn.jquery.com">Learn jQuery</a>
@@ -29,7 +29,7 @@ $("a").trigger("click");
2929

3030
## How can I mimic a native browser event, if not `.trigger()`?
3131

32-
In order to trigger a native browser event, you have to use [document.createEventObject](http://msdn.microsoft.com/en-us/library/ie/ms536390(v=vs.85).aspx) for < IE9 and [document.createEvent](https://developer.mozilla.org/en/DOM/document.createEvent) for all other browsers.
32+
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.
3333
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.
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.

page/using-jquery-core/manipulating-elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jQuery offers a trivial and elegant way to create new elements using the same `$
8383
// Creating new elements from an HTML string
8484
$("<p>This is a new paragraph</p>");
8585
86-
$("<li class="new">new list item</li>");
86+
$("<li class=\"new\">new list item</li>");
8787
```
8888

8989
```

0 commit comments

Comments
 (0)