Skip to content

Commit 6b938e1

Browse files
committed
Removed use of .trim() in globalEval, fixes jquery#4036.
1 parent b16da9d commit 6b938e1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,7 @@ jQuery.extend({
627627

628628
// Evalulates a script in a global context
629629
globalEval: function( data ) {
630-
data = jQuery.trim( data );
631-
632-
if ( data ) {
630+
if ( data && /\S/.test(data) ) {
633631
// Inspired by code by Andrea Giammarchi
634632
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
635633
var head = document.getElementsByTagName("head")[0] || document.documentElement,

0 commit comments

Comments
 (0)