From: John Resig Date: Mon, 9 Feb 2009 15:35:33 +0000 (+0000) Subject: Removed use of .trim() in globalEval, fixes #4036. X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=6b938e1c162877ee62681f8aefe6f64ba208eead;p=jquery.git Removed use of .trim() in globalEval, fixes #4036. --- diff --git a/src/core.js b/src/core.js index ebad0c1..3f6c1f7 100644 --- a/src/core.js +++ b/src/core.js @@ -627,9 +627,7 @@ jQuery.extend({ // Evalulates a script in a global context globalEval: function( data ) { - data = jQuery.trim( data ); - - if ( data ) { + if ( data && /\S/.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement,