Skip to content
Permalink
Browse files
Re-work the document scoping.
  • Loading branch information
jeresig committed Sep 22, 2010
1 parent 9ad7c21 commit 19b5d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
@@ -12,9 +12,6 @@ var jQuery = function( selector, context ) {
// Map over the $ in case of overwrite
_$ = window.$,

// Use the correct document accordingly with window argument (sandbox)
//document = window.document,

// A central reference to the root jQuery(document)
rootjQuery,

@@ -15,3 +15,5 @@
*/
(function( window, undefined ) {

// Use the correct document accordingly with window argument (sandbox)
var document = window.document;

This comment has been minimized.

Copy link
@davidmurdoch

davidmurdoch Sep 22, 2010

I've always been curious as to what environments document is not relative to window.

This comment has been minimized.

Copy link
@jeresig

jeresig Sep 22, 2010

Author Member

Hmm? This particular technique is being used to allow us to optimize the use of document inside jQuery (we can compress it better and accesses are faster).

This comment has been minimized.

Copy link
@davidmurdoch

davidmurdoch Sep 22, 2010

Ah. I've always been a fan of (function(window, document, undefined){ /*...*/ }(window, document)); which compresses even better. :-)

0 comments on commit 19b5d9e

Please sign in to comment.