aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-03-01 05:16:34 +0000
committerJohn Resig <jeresig@gmail.com>2007-03-01 05:16:34 +0000
commit9791855ea91988e9ff02063e0c5ece759d8ba898 (patch)
tree4ca79fa5fda7f97c8f7d012e2e44899f57d6abf5 /src
parent6b729ff7984d9d4d09dff042a3896022dae3783d (diff)
downloadjquery-9791855ea91988e9ff02063e0c5ece759d8ba898.tar.gz
jquery-9791855ea91988e9ff02063e0c5ece759d8ba898.zip
Fix for bug #962.
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js8
-rw-r--r--src/jquery/jquery.js2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 25cb69b30..c20d4068d 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() {
});
test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
- expect(10);
+ expect(11);
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,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
ok( $("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" );
reset();
+ $("#sap").append( " text with spaces " );
+ ok( $("#sap")[0].innerHTML.match(/ text with spaces $/), "Check for appending text with spaces" );
+
+ reset();
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." );
@@ -698,4 +702,4 @@ test("click() context", function() {
//console.log( close[0]); // it's the <a> and not a <span> element
return false;
}).click();
-}); \ No newline at end of file
+});
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 5780ba76b..48740377c 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1472,7 +1472,7 @@ jQuery.extend({
[0,"",""];
// Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + s + wrap[2];
+ div.innerHTML = wrap[1] + arg + wrap[2];
// Move to the right depth
while ( wrap[0]-- )