Skip to content
Permalink
Browse files

Re-work the document scoping.

  • Loading branch information...
jeresig committed Sep 22, 2010
1 parent 9ad7c21 commit 19b5d9e874bbd97d03d9e0561a70711e2bf91fcb
Showing with 2 additions and 3 deletions.
  1. +0 −3 src/core.js
  2. +2 −0 src/intro.js
@@ -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.

@davidmurdoch

davidmurdoch Sep 22, 2010

Contributor

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

This comment has been minimized.

@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.

@davidmurdoch

davidmurdoch Sep 22, 2010

Contributor

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.
You can’t perform that action at this time.