From: John Resig Date: Wed, 15 Jul 2009 12:35:57 +0000 (+0000) Subject: Scope 'document' locally (also useful for sandboxing). Patch from Andrea Giammarchi... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=c5315f66870377579cb41a1c0d80389c02628a66 Scope 'document' locally (also useful for sandboxing). Patch from Andrea Giammarchi. Fixes bug #4905. --- diff --git a/src/core.js b/src/core.js index cab3b54..ee4ac70 100644 --- a/src/core.js +++ b/src/core.js @@ -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,