aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-01-03 00:51:07 +0000
committerJohn Resig <jeresig@gmail.com>2009-01-03 00:51:07 +0000
commitc0294278db40da764a98ea1c1506548e539213c7 (patch)
treebec64cc1aa2fcc0cf209e66d019536c56ef62675 /src
parentcff37cc83559586d3cc514d620880f2d9103fae9 (diff)
downloadjquery-c0294278db40da764a98ea1c1506548e539213c7.tar.gz
jquery-c0294278db40da764a98ea1c1506548e539213c7.zip
Landed a proper fix for #3255 - which involves doing createElement instead of going through the normal clean method.
Diffstat (limited to 'src')
-rw-r--r--src/core.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core.js b/src/core.js
index 2688a4698..592c9a033 100644
--- a/src/core.js
+++ b/src/core.js
@@ -819,6 +819,14 @@ jQuery.extend({
if ( typeof context.createElement === "undefined" )
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
+ var match = /^<(\w+)\/?>$/.exec(elems[0]);
+ if ( match )
+ return [ context.createElement( match[1] ) ];
+ }
+
var ret = [], scripts = [], div = context.createElement("div");
jQuery.each(elems, function(i, elem){
@@ -915,12 +923,6 @@ jQuery.extend({
});
- // Clean up
- // Safari 3.1 throws an exception when a colgroup is created
- try {
- div.innerHTML = "";
- } catch(e){}
-
if ( fragment ) {
for ( var i = 0; ret[i]; i++ ) {
var node = ret[i];