github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1,760
    • 169
  • Source
  • Commits
  • Network (169)
  • Graphs
  • Tree: a4043cd

click here to add a description

click here to add a homepage

  • Switch Branches (3)
    • master
    • mobile
    • omgrequire
  • Switch Tags (41)
    • 1.4rc1
    • 1.4a2
    • 1.4a1
    • 1.4.2
    • 1.4.1
    • 1.4
    • 1.3rc1
    • 1.3b2
    • 1.3b1
    • 1.3.2
    • 1.3.1rc1
    • 1.3.1
    • 1.3
    • 1.2.6
    • 1.2.5
    • 1.2.4b
    • 1.2.4a
    • 1.2.4
    • 1.2.3b
    • 1.2.3a
    • 1.2.3
    • 1.2.2b2
    • 1.2.2b
    • 1.2.2
    • 1.2.1
    • 1.2
    • 1.1b
    • 1.1a
    • 1.1.4
    • 1.1.3a
    • 1.1.3.1
    • 1.1.3
    • 1.1.2
    • 1.1.1
    • 1.1
    • 1.0a
    • 1.0.4
    • 1.0.3
    • 1.0.2
    • 1.0.1
    • 1.0
  • Comments
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

jQuery JavaScript Library — Read more

  Cancel

http://jquery.com/

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Land some additional tweaks related to running through JSLint.
jeresig (author)
Mon Mar 01 15:19:29 -0800 2010
commit  a4043cdcbfa1ca069265a7cbcaba269629789cc0
tree    2659778180cecf9f08614f814e34bac5beefe42f
parent  fc08d0ea8dc881ed56102eb14e3ad9c54cccc34e
M src/ajax.js 2 ••
M src/core.js 12 ••••
M src/event.js 2 ••
M src/manipulation.js 2 ••
M src/traversing.js 3 •••
0
src/ajax.js
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ var jsc = now(),
0
   rscript = /<script(.|\s)*?\/script>/gi,
0
   rselectTextarea = /select|textarea/i,
0
   rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
0
-  jsre = /=\?(&|$)/,
0
+  jsre = /\=\?(&|$)/,
0
   rquery = /\?/,
0
   rts = /(\?|&)_=.*?(&|$)/,
0
   rurl = /^(\w+:)?\/\/([^\/?#]+)/,
0
src/core.js
...
49
50
51
52
 
53
54
55
...
450
451
452
453
454
455
 
 
 
456
457
458
...
462
463
464
465
 
466
467
468
...
803
804
805
806
 
807
...
49
50
51
 
52
53
54
55
...
450
451
452
 
 
 
453
454
455
456
457
458
...
462
463
464
 
465
466
467
468
...
803
804
805
 
806
807
0
@@ -49,7 +49,7 @@ var jQuery = function( selector, context ) {
0
 
0
   // Save a reference to some core methods
0
   toString = Object.prototype.toString,
0
-  hasOwnProperty = Object.prototype.hasOwnProperty,
0
+  hasOwn = Object.prototype.hasOwnProperty,
0
   push = Array.prototype.push,
0
   slice = Array.prototype.slice,
0
   indexOf = Array.prototype.indexOf;
0
@@ -450,9 +450,9 @@ jQuery.extend({
0
     }
0
     
0
     // Not own constructor property must be Object
0
-    if ( obj.constructor
0
-      && !hasOwnProperty.call(obj, "constructor")
0
-      && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
0
+    if ( obj.constructor &&
0
+      !hasOwn.call(obj, "constructor") &&
0
+      !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
0
       return false;
0
     }
0
     
0
@@ -462,7 +462,7 @@ jQuery.extend({
0
     var key;
0
     for ( key in obj ) {}
0
     
0
-    return key === undefined || hasOwnProperty.call( obj, key );
0
+    return key === undefined || hasOwn.call( obj, key );
0
   },
0
 
0
   isEmptyObject: function( obj ) {
0
@@ -803,5 +803,5 @@ function access( elems, key, value, exec, fn, pass ) {
0
 }
0
 
0
 function now() {
0
-  return (new Date).getTime();
0
+  return (new Date()).getTime();
0
 }
0
src/event.js
...
187
188
189
190
 
191
192
193
...
187
188
189
 
190
191
192
193
0
@@ -187,7 +187,7 @@ jQuery.event = {
0
         type = namespaces.shift();
0
 
0
         namespace = new RegExp("(^|\\.)" + 
0
-          jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
0
+          jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
0
       }
0
 
0
       eventType = events[ type ];
0
src/manipulation.js
...
205
206
207
208
 
209
210
211
...
205
206
207
 
208
209
210
211
0
@@ -205,7 +205,7 @@ jQuery.fn.extend({
0
 
0
         return jQuery.clean([html.replace(rinlinejQuery, "")
0
           // Handle the case in IE 8 where action=/test/> self-closes a tag
0
-          .replace(/=([^="'>\s]+\/)>/g, '="$1">')
0
+          .replace(/\=([^="'>\s]+\/)>/g, '="$1">')
0
           .replace(rleadingWhitespace, "")], ownerDocument)[0];
0
       } else {
0
         return this.cloneNode(true);
0
src/traversing.js
...
1
2
3
4
5
 
6
7
8
...
1
2
3
 
 
4
5
6
7
0
@@ -1,8 +1,7 @@
0
 var runtil = /Until$/,
0
   rparentsprev = /^(?:parents|prevUntil|prevAll)/,
0
   // Note: This RegExp should be improved, or likely pulled from Sizzle
0
-  rmultiselector = /,/,
0
-  slice = Array.prototype.slice;
0
+  rmultiselector = /,/;
0
 
0
 // Implement the identical functionality for filter and not
0
 var winnow = function( elements, qualifier, keep ) {

Comments

jamespadolsey Tue Mar 02 10:06:17 -0800 2010

In reference to 806, what's wrong with +new Date()?

jeresig Tue Mar 02 10:14:02 -0800 2010

@James: Nothing in particular (in that it works) but I've balked against it in the past because it's particularly "magical" and not always obvious what it's doing to someone who may be reading the source - whereas (new Date()).getTime() is very explicit and very obvious as to what the result is.

jamespadolsey Tue Mar 02 10:31:48 -0800 2010

Fair point. I'm surprised closure compiler doesn't switch new Date().getTime() for +new Date...

jdalton Tue Mar 02 10:53:06 -0800 2010

Nothing magical about it. ECMA 5th Ed. Page 169, Section 15.9.3.1 [[PrimitiveValue]] makes it pretty clear. (new Date).valueOf(); would also do :P

jeresig Tue Mar 02 11:01:44 -0800 2010

@jdalton: To someone that reads specifications for fun, of course there's "Nothing magical about it." - but it's undeniable that it's much more obtuse than just doing a straight (new Date()).getTime(); or (new Date()).valueOf();.

jdalton Tue Mar 02 11:35:47 -0800 2010

Hehe, I hear @kangax is getting a tramp stamp that reads "strict";

jdalton Tue Mar 02 11:45:15 -0800 2010

*erm "use strict";, humor fail :D

cowboy Tue Mar 02 12:34:26 -0800 2010

Why not use +new Date() and then include a comment. You know, one of those new-fangled thingamawhatsits often included in source code just like this that explains to the uneducated developer what that particular bit of magic does?

yfeldblum Tue Mar 02 13:01:03 -0800 2010

Comments are verboten.

On a serious note, it's a popular idea that code should be clear - that if a piece of code needs comments to explain what it does, then that piece of code should be rewritten no longer to need comments.

Appropriate optimizations are exceptions to this rule, as are such things as high-level descriptions of algorithms and data structures, high-level descriptions of design and architecture, examples of how to invoke the code, key assumptions and contexts, etc.

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server