Scope 'document' locally (also useful for sandboxing). Patch from Andrea Giammarchi...
[jquery.git] / src / core.js
index cab3b54..ee4ac70 100644 (file)
@@ -12,6 +12,9 @@ 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,