Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
9791855e
Commit
9791855e
authored
Mar 01, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #962.
parent
6b729ff7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
coreTest.js
src/jquery/coreTest.js
+6
-2
jquery.js
src/jquery/jquery.js
+1
-1
No files found.
src/jquery/coreTest.js
View file @
9791855e
...
@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() {
...
@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() {
});
});
test
(
"append(String|Element|Array<Element>|jQuery)"
,
function
()
{
test
(
"append(String|Element|Array<Element>|jQuery)"
,
function
()
{
expect
(
1
0
);
expect
(
1
1
);
var
defaultText
=
'Try them out:'
var
defaultText
=
'Try them out:'
var
result
=
$
(
'#first'
).
append
(
'<b>buga</b>'
);
var
result
=
$
(
'#first'
).
append
(
'<b>buga</b>'
);
ok
(
result
.
text
()
==
defaultText
+
'buga'
,
'Check if text appending works'
);
ok
(
result
.
text
()
==
defaultText
+
'buga'
,
'Check if text appending works'
);
...
@@ -238,6 +238,10 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
...
@@ -238,6 +238,10 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
$
(
"#sap"
).
append
(
5
);
$
(
"#sap"
).
append
(
5
);
ok
(
$
(
"#sap"
)[
0
].
innerHTML
.
match
(
/5$/
),
"Check for appending a number"
);
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
();
reset
();
ok
(
$
(
"#sap"
).
append
([]),
"Check for appending an empty array."
);
ok
(
$
(
"#sap"
).
append
([]),
"Check for appending an empty array."
);
ok
(
$
(
"#sap"
).
append
(
""
),
"Check for appending an empty string."
);
ok
(
$
(
"#sap"
).
append
(
""
),
"Check for appending an empty string."
);
...
...
src/jquery/jquery.js
View file @
9791855e
...
@@ -1472,7 +1472,7 @@ jQuery.extend({
...
@@ -1472,7 +1472,7 @@ jQuery.extend({
[
0
,
""
,
""
];
[
0
,
""
,
""
];
// Go to html and back, then peel off extra wrappers
// 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
// Move to the right depth
while
(
wrap
[
0
]
--
)
while
(
wrap
[
0
]
--
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment