Skip to content
Permalink
Browse files

IE prunes whitespace from the start of innerHTML-injected strings. Th…

…is fixes that.
  • Loading branch information
jeresig committed Jul 30, 2007
1 parent d8e9f0c commit 334462b23c3daca53f2fbff177693f0f1ba29c48
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/jquery/jquery.js
@@ -1587,7 +1587,11 @@ jQuery.extend({
for ( var n = tb.length-1; n >= 0 ; --n )
if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
tb[n].parentNode.removeChild(tb[n]);


// IE completely kills leading whitespace when innerHTML is used
if ( /^\s/.test(arg) )
div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );

}

arg = jQuery.makeArray( div.childNodes );

0 comments on commit 334462b

Please sign in to comment.
You can’t perform that action at this time.