git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8e9f0c
)
IE prunes whitespace from the start of innerHTML-injected strings. This fixes that.
author
John Resig
<jeresig@gmail.com>
Mon, 30 Jul 2007 02:14:06 +0000
(
02:14
+0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 30 Jul 2007 02:14:06 +0000
(
02:14
+0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
705a5bb
..
a0a2009
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
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 );