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
bfad45fe
Commit
bfad45fe
authored
May 03, 2011
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem with appending multiple string arguments in IE 6. Fixes #9072.
parent
3cdffce1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
manipulation.js
src/manipulation.js
+4
-4
manipulation.js
test/unit/manipulation.js
+12
-1
No files found.
src/manipulation.js
View file @
bfad45fe
...
@@ -582,7 +582,7 @@ jQuery.extend({
...
@@ -582,7 +582,7 @@ jQuery.extend({
context
=
context
.
ownerDocument
||
context
[
0
]
&&
context
[
0
].
ownerDocument
||
document
;
context
=
context
.
ownerDocument
||
context
[
0
]
&&
context
[
0
].
ownerDocument
||
document
;
}
}
var
ret
=
[];
var
ret
=
[]
,
j
;
for
(
var
i
=
0
,
elem
;
(
elem
=
elems
[
i
])
!=
null
;
i
++
)
{
for
(
var
i
=
0
,
elem
;
(
elem
=
elems
[
i
])
!=
null
;
i
++
)
{
if
(
typeof
elem
===
"number"
)
{
if
(
typeof
elem
===
"number"
)
{
...
@@ -628,7 +628,7 @@ jQuery.extend({
...
@@ -628,7 +628,7 @@ jQuery.extend({
div
.
childNodes
:
div
.
childNodes
:
[];
[];
for
(
var
j
=
tbody
.
length
-
1
;
j
>=
0
;
--
j
)
{
for
(
j
=
tbody
.
length
-
1
;
j
>=
0
;
--
j
)
{
if
(
jQuery
.
nodeName
(
tbody
[
j
],
"tbody"
)
&&
!
tbody
[
j
].
childNodes
.
length
)
{
if
(
jQuery
.
nodeName
(
tbody
[
j
],
"tbody"
)
&&
!
tbody
[
j
].
childNodes
.
length
)
{
tbody
[
j
].
parentNode
.
removeChild
(
tbody
[
j
]
);
tbody
[
j
].
parentNode
.
removeChild
(
tbody
[
j
]
);
}
}
...
@@ -649,8 +649,8 @@ jQuery.extend({
...
@@ -649,8 +649,8 @@ jQuery.extend({
var
len
;
var
len
;
if
(
!
jQuery
.
support
.
appendChecked
)
{
if
(
!
jQuery
.
support
.
appendChecked
)
{
if
(
elem
[
0
]
&&
typeof
(
len
=
elem
.
length
)
===
"number"
)
{
if
(
elem
[
0
]
&&
typeof
(
len
=
elem
.
length
)
===
"number"
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
findInputs
(
elem
[
i
]
);
findInputs
(
elem
[
j
]
);
}
}
}
else
{
}
else
{
findInputs
(
elem
);
findInputs
(
elem
);
...
...
test/unit/manipulation.js
View file @
bfad45fe
...
@@ -227,7 +227,7 @@ test("unwrap()", function() {
...
@@ -227,7 +227,7 @@ test("unwrap()", function() {
});
});
var
testAppend
=
function
(
valueObj
)
{
var
testAppend
=
function
(
valueObj
)
{
expect
(
4
0
);
expect
(
4
1
);
var
defaultText
=
"Try them out:"
var
defaultText
=
"Try them out:"
var
result
=
jQuery
(
"#first"
).
append
(
valueObj
(
"<b>buga</b>"
));
var
result
=
jQuery
(
"#first"
).
append
(
valueObj
(
"<b>buga</b>"
));
equals
(
result
.
text
(),
defaultText
+
"buga"
,
"Check if text appending works"
);
equals
(
result
.
text
(),
defaultText
+
"buga"
,
"Check if text appending works"
);
...
@@ -344,6 +344,17 @@ var testAppend = function(valueObj) {
...
@@ -344,6 +344,17 @@ var testAppend = function(valueObj) {
equals
(
$radio
[
0
].
checked
,
true
,
"Reappending radios uphold which radio is checked"
);
equals
(
$radio
[
0
].
checked
,
true
,
"Reappending radios uphold which radio is checked"
);
equals
(
$radioNot
[
0
].
checked
,
false
,
"Reappending radios uphold not being checked"
);
equals
(
$radioNot
[
0
].
checked
,
false
,
"Reappending radios uphold not being checked"
);
QUnit
.
reset
();
QUnit
.
reset
();
var
prev
=
jQuery
(
"#sap"
).
children
().
length
;
jQuery
(
"#sap"
).
append
(
"<span></span>"
,
"<span></span>"
,
"<span></span>"
);
equals
(
jQuery
(
"#sap"
).
children
().
length
,
prev
+
3
,
"Make sure that multiple arguments works."
);
QUnit
.
reset
();
}
}
test
(
"append(String|Element|Array<Element>|jQuery)"
,
function
()
{
test
(
"append(String|Element|Array<Element>|jQuery)"
,
function
()
{
...
...
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