Showing with 547 additions and 1,027 deletions.
  1. +16 −16 page/about-jquery/additional-support.md
  2. +4 −3 page/about-jquery/how-jquery-works.md
  3. +1 −3 page/about.md
  4. +22 −14 page/ajax/ajax-and-forms.md
  5. +9 −10 page/ajax/ajax-events.md
  6. +39 −91 page/ajax/jquery-ajax-methods.md
  7. +13 −48 page/ajax/key-concepts.md
  8. +8 −15 page/ajax/working-with-jsonp.md
  9. +1 −0 page/code-organization.md
  10. +2 −3 page/code-organization/beware-anonymous-functions.md
  11. +44 −110 page/code-organization/concepts.md
  12. +36 −64 page/code-organization/deferreds.md
  13. +52 −112 page/code-organization/deferreds/examples.md
  14. +12 −48 page/code-organization/deferreds/jquery-deferreds.md
  15. +1 −0 page/code-organization/dont-repeat-yourself.md
  16. +9 −9 page/code-organization/feature-browser-detection.md
  17. +3 −5 page/effects.md
  18. +14 −18 page/effects/custom-effects.md
  19. +19 −53 page/effects/intro-to-effects.md
  20. +33 −35 page/effects/queue-and-dequeue-explained.md
  21. +51 −63 page/effects/uses-of-queue-and-dequeue.md
  22. +5 −10 page/events.md
  23. +22 −54 page/events/event-basics.md
  24. +9 −8 page/events/event-delegation.md
  25. +4 −3 page/events/event-extensions.md
  26. +3 −9 page/events/event-helpers.md
  27. +25 −45 page/events/handling-events.md
  28. +9 −0 page/events/history-of-events.md
  29. +4 −10 page/events/inside-event-handling-function.md
  30. +58 −142 page/events/introduction-to-custom-events.md
  31. +0 −2 page/events/introduction-to-events.md
  32. +7 −18 page/events/triggering-event-handlers.md
  33. +12 −6 page/index.html
@@ -11,29 +11,29 @@ http://forum.jquery.com/
There are many subforums where you can discuss jQuery, ask questions, talk about JavaScript, or announce your plugins.

* [Getting Started](http://forum.jquery.com/getting-started)
* This is the best place to post if you are brand new to jQuery and JavaScript.
* This is the best place to post if you are brand new to jQuery and JavaScript.
* [Using jQuery](http://forum.jquery.com/using-jquery)
* This is the best place to post if you have general questions or concerns.
* If you've built a site that uses jQuery, or would like to announce a new plugin, this is the place to do it.
* This is the best place to post if you have general questions or concerns.
* If you've built a site that uses jQuery, or would like to announce a new plugin, this is the place to do it.
* [Using jQuery Plugins](http://forum.jquery.com/using-jquery-plugins)
* If you are a plugin author or user and you wish to discuss specific plugins, plugin bugs, new features, or new plugins.
* If you are a plugin author or user and you wish to discuss specific plugins, plugin bugs, new features, or new plugins.
* [Using jQuery UI](http://forum.jquery.com/using-jquery-ui)
* This is the place to discuss use of [jQuery UI](http://jqueryui.com/) Interactions, Widgets, and Effects
* This is the place to discuss use of [jQuery UI](http://jqueryui.com/) Interactions, Widgets, and Effects
* [jQuery Mobile](http://forum.jquery.com/jquery-mobile)
* This is the place to discuss jQuery Mobile.
* This is the place to discuss jQuery Mobile.
* [Developing jQuery Core](http://forum.jquery.com/developing-jquery-core)
* This forum centers around development of the jQuery library itself.
* Post here if you have questions about certain bugs, development with jQuery, features, or anything in the bug tracker or Git.
* This forum centers around development of the jQuery library itself.
* Post here if you have questions about certain bugs, development with jQuery, features, or anything in the bug tracker or Git.
* [Developing jQuery Plugins](http://forum.jquery.com/developing-jquery-plugins)
* This forum covers development of jQuery plugins.
* This forum covers development of jQuery plugins.
* [Developing jQuery UI](http://forum.jquery.com/developing-jquery-ui)
* This is the place to discuss development of [jQuery UI](http://jqueryui.com/) itself – including bugs, new plugins, and how you can help.
* All jQuery UI svn commits are posted to this list to facilitate feedback, discussion, and review.
* Also note that a lot of the development and planning of jQuery UI takes place on the [jQuery UI Development and Planning Wiki](http://wiki.jqueryui.com/).
* This is the place to discuss development of [jQuery UI](http://jqueryui.com/) itself – including bugs, new plugins, and how you can help.
* All jQuery UI svn commits are posted to this list to facilitate feedback, discussion, and review.
* Also note that a lot of the development and planning of jQuery UI takes place on the [jQuery UI Development and Planning Wiki](http://wiki.jqueryui.com/).
* [Developing jQuery Mobile](http://forum.jquery.com/developing-jquery-mobile)
* This forum covers issues related to the development of jQuery Mobile.
* This forum covers issues related to the development of jQuery Mobile.
* [QUnit and Testing](http://forum.jquery.com/qunit-and-testing)
* This is the place to discuss JavaScript testing in general and QUnit in particular
* This is the place to discuss JavaScript testing in general and QUnit in particular

At the bottom of each of the forums is an RSS feed you can subscribe to.

@@ -76,7 +76,7 @@ The IRC Channel is best if you need quick help with any of the following:

If your problem is more in-depth, we may ask you to post to the mailing list, or the bug tracker, so that we can help you in a more-suitable environment.

####Connect info:
#### Connect info:

**Server:** irc.freenode.net

@@ -86,7 +86,7 @@ You can also connect at http://webchat.freenode.net/?channels=#jquery.

Additionally we have `#jquery-es` and `#jquery-de` if you want to speak your native language.

If you wish to post code snippets to the channel, you should use a paste site, like [jsfiddle.net](http://jsfiddle.net/) or [jsbin.com](http://jsbin.com/)
If you wish to post code snippets to the channel, you should use a paste site, like [jsfiddle.net](http://jsfiddle.net/) or [jsbin.com](http://jsbin.com/).

### StackOverflow

@@ -11,7 +11,7 @@ This is a basic tutorial, designed to help you get started using jQuery. If you
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Demo</title>
</head>
<body>
@@ -39,7 +39,7 @@ window.onload = function() {
alert( "welcome" );
}
};
```

Unfortunately, the code doesn't run until all images are finished downloading, including banner ads. To run code as soon as the document is ready to be manipulated, jQuery has a statement known as the [ready event](http://api.jquery.com/ready/):
@@ -95,7 +95,7 @@ The following example illustrates the click handling code discussed above, embed
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Demo</title>
</head>
<body>
@@ -184,6 +184,7 @@ When [$.get()](http://api.jquery.com/jQuery.get/) finishes getting the page `myh
Executing callbacks with arguments can be tricky.

#### Wrong

This code example will ***not*** work:

```
@@ -10,9 +10,7 @@ Learning how and when to use jQuery is a different process for each and every we

However, API documentation alone cannot serve as a guide to solving problems and fostering a true understanding of web development. Over the years, an ecosystem of blog posts, books, support forums, and channels has grown to help cover the **hows** and **whys** of developing with jQuery, as well as explaining best practices, techniques, and workarounds for common problems. This type of documentation has been invaluable resource for millions of people, but the experience of navigating these waters can be frustrating as often as it is fulfilling, as developers struggle to identify trustworthy resources, determine whether what they're reading is actually up to date, and figure out those magical search keywords that are _just right_!

This site represents the jQuery Foundation's ongoing effort to consolidate and
curate this information in order to provide this crucial "narrative
documentation" to our community and serve the following goals:
This site represents the jQuery Foundation's ongoing effort to consolidate and curate this information in order to provide this crucial "narrative documentation" to our community and serve the following goals:

1. Provide our **users** with a digestible reference on all aspects of using jQuery, from the basics of getting started and performing common tasks to more advanced topics like approaches to structuring code and where jQuery fits into modern web application development.
2. Provide our **contributors** a central, open place to collaborate and provide a dependable, highly sharable resource that will improve our users' support experiences.
@@ -18,7 +18,7 @@ The `.serialize()` method serializes a form's data into a query string. For the
// Turning form data into a query string
$( "#myForm" ).serialize();
// creates a query string like this:
// Creates a query string like this:
// field_1=something&field2=somethingElse
```

@@ -28,7 +28,7 @@ While plain old serialization is great, sometimes your application would work be
// Creating an array of objects containing form data
$( "#myForm" ).serializeArray();
// creates a structure like this:
// Creates a structure like this:
// [
// {
// name : "field_1",
@@ -42,6 +42,7 @@ $( "#myForm" ).serializeArray();
```

### Client-side validation

Client-side validation is, much like many other things, extremely easy using jQuery. While there are several cases developers can test for, some of the most common ones are: presence of a required input, valid usernames/emails/phone numbers/etc&hellip;, or checking an "I agree&hellip;" box.

Please note that it is advisable that you also perform server-side validation for your inputs. However, it typically makes for a better user experience to be able to validate some things without submitting the form.
@@ -51,14 +52,17 @@ With that being said, let's jump on in to some examples! First, we'll see how ea
```
// Using validation to check for the presence of an input
$( "#form" ).submit(function( event ) {
// if .required's value's length is zero
// If .required's value's length is zero
if ( $( ".required" ).val().length === 0 ) {
// usually show some kind of error message here
// this prevents the form from submitting
return false;
// Usually show some kind of error message here
// Prevent the form from submitting
event.preventDefault();
} else {
// run $.ajax here
// Run $.ajax() here
}
});
```
@@ -70,22 +74,25 @@ Let's see how easy it is to check for invalid characters in a phone number:
$( "#form" ).submit(function( event ) {
var inputtedPhoneNumber = $( "#phone" ).val();
// match only numbers
// Match only numbers
var phoneNumberRegex = /^\d*$/;
// if the phone number doesn't match the regex
// If the phone number doesn't match the regex
if ( !phoneNumberRegex.test( inputtedPhoneNumber ) ) {
// usually show some kind of error message here
// prevent the form from submitting
return false;
// Usually show some kind of error message here
// Prevent the form from submitting
event.preventDefault();
} else {
// run $.ajax here
// Run $.ajax() here
}
});
```

### Prefiltering

A prefilter is a way to modify the ajax options before each request is sent (hence, the name `prefilter`).

For example, say we would like to modify all cross-domain requests through a proxy. To do so with a prefilter is quite simple:
@@ -105,7 +112,8 @@ You can pass in an optional argument before the callback function that specifies
```
// Using the optional dataTypes argument
$.ajaxPrefilter( "json script", function( options, originalOptions, jqXHR ) {
// do all of the prefiltering here, but only for
// Do all of the prefiltering here, but only for
// requests that indicate a dataType of "JSON" or "script"
});
```
@@ -5,17 +5,16 @@ source: http://jqfundamentals.com/legacy
attribution:
- jQuery Fundamentals
---
Often, you'll want to perform an operation whenever an Ajax requests starts or
stops, such as showing or hiding a loading indicator. Rather than defining
this behavior inside every Ajax request, you can bind Ajax events to elements
just like you'd bind other events. For a complete list of Ajax events, visit
[Ajax Events documentation on docs.jquery.com](http://docs.jquery.com/Ajax_Events).

Often, you'll want to perform an operation whenever an Ajax requests starts or stops, such as showing or hiding a loading indicator. Rather than defining this behavior inside every Ajax request, you can bind Ajax events to elements just like you'd bind other events. For a complete list of Ajax events, visit [Ajax Events documentation on docs.jquery.com](http://docs.jquery.com/Ajax_Events).

```
// Setting up a loading indicator using Ajax Events
$( "#loading_indicator" ).ajaxStart(function() {
$( this ).show();
}).ajaxStop(function() {
$( this ).hide();
});
$( "#loading_indicator" )
.ajaxStart(function() {
$( this ).show();
})
.ajaxStop(function() {
$( this ).hide();
});
```