aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-07 11:15:31 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-07 11:15:31 +0000
commit46001b94f34f7230482e64f5444346ffc5044f2c (patch)
treead1f8a9b60d7dc580b22fc640e935cd8023132b2
parent955fdb87a72e0d85676db932eda9f6a4319306d9 (diff)
downloadjquery-46001b94f34f7230482e64f5444346ffc5044f2c.tar.gz
jquery-46001b94f34f7230482e64f5444346ffc5044f2c.zip
Fix for #754
-rw-r--r--src/jquery/jquery.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 30fd03d28..e3699ae1f 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1165,15 +1165,21 @@ jQuery.extend({
* as $().each() - which is used to iterate, exclusively, over a jQuery
* object. This function can be used to iterate over anything.
*
- * @example $.each( [0,1,2], function(i){
- * alert( "Item #" + i + ": " + this );
+ * The callback has two arguments:the key (objects) or index (arrays) as first
+ * the first, and the value as the second.
+ *
+ * @example $.each( [0,1,2], function(i, n){
+ * alert( "Item #" + i + ": " + n );
* });
- * @desc Iterates over the items in an array, accessing both the current item and its index.
+ * @desc This is an example of iterating over the items in an array,
+ * accessing both the current item and its index.
*
- * @example $.each( { name: "John", lang: "JS" }, function(i){
- * alert( "Name: " + i + ", Value: " + this );
+ * @example $.each( { name: "John", lang: "JS" }, function(i, n){
+ * alert( "Name: " + i + ", Value: " + n );
* });
- * @desc Iterates over the properties in an Object, accessing both the current item and its key.
+ *
+ * @desc This is an example of iterating over the properties in an
+ * Object, accessing both the current item and its key.
*
* @name $.each
* @param Object obj The object, or array, to iterate over.