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 ebad0c1..3f6c1f7 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,