From c5315f66870377579cb41a1c0d80389c02628a66 Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 15 Jul 2009 12:35:57 +0000 Subject: [PATCH] Scope 'document' locally (also useful for sandboxing). Patch from Andrea Giammarchi. Fixes bug #4905. --- src/core.js | 3 +++ 1 file changed, 3 insertions(+) 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, -- 1.7.10.4