- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
jQuery.each(elems, function(i, elem) {
if (typeof elem === "number") {
elem += "";
}
if (!elem) {
return;
}
if (typeof elem === "string" && !rhtml.test(elem)) {
elem = context.createTextNode(elem);
} else if (typeof elem === "string") {
elem = elem.replace(rxhtmlTag, fcloseTag);
var tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[tag] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
div.innerHTML = wrap[1] + elem + wrap[2];
while (depth--) {
div = div.lastChild;
}
if (!jQuery.support.tbody) {
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : wrap[1] === "<table>" && !hasBody ? div.childNodes : [];
for (var j = tbody.length - 1; j >= 0; --j) {
if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) {
tbody[j].parentNode.removeChild(tbody[j]);
}
}
}
if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) {
div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]), div.firstChild);
}
elem = jQuery.makeArray(div.childNodes);
}
if (elem.nodeType) {
ret.push(elem);
} else {
ret = jQuery.merge(ret, elem);
}
});