]> source.dussan.org Git - jquery.git/commitdiff
Removed use of .trim() in globalEval, fixes #4036.
authorJohn Resig <jeresig@gmail.com>
Mon, 9 Feb 2009 15:35:33 +0000 (15:35 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 9 Feb 2009 15:35:33 +0000 (15:35 +0000)
src/core.js

index ebad0c1b68215b521c972a0c4a58262d53b0c576..3f6c1f75af840c15900a7d17363a8112895cbff3 100644 (file)
@@ -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,