aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Aaron <brandon.aaron@gmail.com>2007-02-07 15:06:49 +0000
committerBrandon Aaron <brandon.aaron@gmail.com>2007-02-07 15:06:49 +0000
commitecaa4d4570b05610d542b971fc4278de3c251e79 (patch)
tree6be111ba138062015eb7f9682d76ed88b770ea13
parent980b5d72dba596483be586a276d3a385519ee7ef (diff)
downloadjquery-ecaa4d4570b05610d542b971fc4278de3c251e79.tar.gz
jquery-ecaa4d4570b05610d542b971fc4278de3c251e79.zip
Fix for #910
-rw-r--r--src/jquery/coreTest.js7
-rw-r--r--src/jquery/jquery.js2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index da4aca057..1410ece7c 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -210,7 +210,7 @@ test("wrap(String|Element)", function() {
});
test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
- expect(9);
+ expect(10);
var defaultText = 'Try them out:'
var result = $('#first').append('<b>buga</b>');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -239,6 +239,11 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
ok( $("#sap").append([]), "Check for appending an empty array." );
ok( $("#sap").append(""), "Check for appending an empty string." );
ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." );
+
+ reset();
+ $("#sap").append(document.getElementById('form'));
+ ok( $("#sap>form").size() == 1, "Check for appending a form" );
+
});
test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index cdd614c2f..1eb211a76 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1470,7 +1470,7 @@ jQuery.extend({
if ( arg.length === 0 )
return;
- if ( arg[0] == undefined )
+ if ( arg[0] == undefined || jQuery.nodeName(arg,"form") )
r.push( arg );
else
r = jQuery.merge( r, arg );