aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2009-12-06 09:06:00 +0800
committerJohn Resig <jeresig@gmail.com>2009-12-06 10:31:57 +0800
commit628e1564c48f2b4d18ed5af89ebed88b09d972d4 (patch)
tree44f17c1f3d7f0f40eeeec8a5003f2fd101e24446 /src
parent3c89e38fc26ef40797b83ba8ef4f8329b08afe75 (diff)
downloadjquery-628e1564c48f2b4d18ed5af89ebed88b09d972d4.tar.gz
jquery-628e1564c48f2b4d18ed5af89ebed88b09d972d4.zip
Fix for #4011, crash when two text nodes are appended in IE.
Diffstat (limited to 'src')
-rw-r--r--src/manipulation.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 7128d11cf..7d7038ee2 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -388,7 +388,7 @@ jQuery.extend({
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
- var ret = [], div = context.createElement("div");
+ var ret = [];
jQuery.each(elems, function(i, elem){
if ( typeof elem === "number" ) {
@@ -408,7 +408,8 @@ jQuery.extend({
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0];
+ depth = wrap[0],
+ div = context.createElement("div");
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];