aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-09-14 23:12:06 +0000
committerJohn Resig <jeresig@gmail.com>2009-09-14 23:12:06 +0000
commit766635e8624f5e61e021086de9e763f2ef6b17ef (patch)
tree063b820cfb493c3b8b2d0d3b74ff2596c7d79429 /src/manipulation.js
parent681f4fd3cdd4bdd23edbba05ed1389fabed86b41 (diff)
downloadjquery-766635e8624f5e61e021086de9e763f2ef6b17ef.tar.gz
jquery-766635e8624f5e61e021086de9e763f2ef6b17ef.zip
Fixed a bug introduced in SVN rev [6537] that caused XML-based fragment creation to fail, in IE.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 4746dc83b..ae4430ad7 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -4,6 +4,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
rtagName = /<(\w+)/,
rtbody = /<tbody/i,
+ rhtml = /</,
fcloseTag = function(all, front, tag){
return rselfClosing.test(tag) ?
all :
@@ -233,7 +234,7 @@ jQuery.fn.extend({
if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
results = { fragment: args[0].parentNode };
} else {
- results = buildFragment( args, this[0], scripts );
+ results = buildFragment( args, this, scripts );
}
first = results.fragment.firstChild;
@@ -368,7 +369,10 @@ jQuery.extend({
if ( !elem ) { return; }
// Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, fcloseTag);