diff options
author | jeresig <jeresig@gmail.com> | 2010-02-01 21:26:47 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-02-01 21:26:47 -0500 |
commit | f95147f465932cb91e1a6aace50c556820ca4074 (patch) | |
tree | ae7acebf9e5b27c54b15c33a1afe862e16285f56 /src/manipulation.js | |
parent | f9417b9da980f4fa79d03ba691d9f3442c5ab2f2 (diff) | |
download | jquery-f95147f465932cb91e1a6aace50c556820ca4074.tar.gz jquery-f95147f465932cb91e1a6aace50c556820ca4074.zip |
Fix for problem in IE 8 where deserialized (then reserialized) form markup was getting malformed. Thanks IE. Fixes #5998.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 543bbcd5e..2dccc7592 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -197,13 +197,15 @@ jQuery.fn.extend({ // as properties will not be copied (such as the // the name attribute on an input). var html = this.outerHTML, ownerDocument = this.ownerDocument; - if ( !html ) { + if ( !html || jQuery.nodeName( this, "form" ) ) { var div = ownerDocument.createElement("div"); div.appendChild( this.cloneNode(true) ); html = div.innerHTML; } return jQuery.clean([html.replace(rinlinejQuery, "") + // Handle the case in IE 8 where action=/test/> self-closes a tag + .replace(/=([^="'>\s]+\/)>/g, '="$1">') .replace(rleadingWhitespace, "")], ownerDocument)[0]; } else { return this.cloneNode(true); |